Difference between revisions of "XvMC"

From ArchWiki
Jump to: navigation, search
(How do I add XvMC support to MPlayer?: - removed 'multimedia' for the /var/abs path)
m (Supported hardware: nvidia-304xx-utils)
(32 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:X Server (English)]]
+
[[Category:Graphics]]
[[Category:HOWTOs (English)]]
+
[[Category:X Server]]
== Introduction ==
+
{{Article summary start}}
<br>
+
{{Article summary text|Explains XvMC support in various hardware and software components.}}
In laymen's terms, XvMC allows the video card (Nvidia ones in this case), to handle processing of certain video features (CPU heavy ones). It takes the load off the CPU, thereby reducing processor requirements for video playback. It is often used in HDTV video playback scenarios.
+
{{Article summary heading|Related}}
<br>
+
{{Article summary wiki|VA-API}}
<br>
+
{{Article summary wiki|MPlayer}}
This guide is to allow Nvidia video card owners to enable XvMC support for MPlayer. (as the default MPlayer build for Arch Linux does NOT support XvMC). It involves using the Arch Build System (or ABS) to recompile MPlayer.
+
{{Article summary end}}
<br>
+
<br>
+
This guide is aimed for the Arch Linux beginner. '''NOT''' for the Linux beginner.
+
<br>
+
<br>
+
== Known Limitations ==
+
<br>
+
There are a few things you need to be aware of:
+
<br>
+
<br>
+
* The current implementation of XvMC for Nvidia cards does NOT support anything other than MPEG1/2 videos. Do NOT bother trying other formats like Xvid, it will NOT work. 
+
* '''ffmpeg12mc''' is the only codec you can use with XvMC. Attempting to try any other codec will result in a FATAL error message.
+
* You can NOT use XvMC simply by running a desktop link calling for '''gmplayer'''. You '''MUST''' use the command line.
+
* The proprietary Nvidia driver is required for XvMC to work.
+
* XvMC is buggy and you may encounter issues under some situations.
+
<br>
+
== What do I need? ==
+
<br>
+
* An Nvidia video card that is known to support XvMC. (ie: GF4MX, GF FX series, GF6xxx and GF7xxx series. Any other older cards will not work. Also note that the GF8xxx series cards no longer support XvMC)
+
* Nvidia proprietary driver installed and working.
+
<br>
+
  
== How do I add XvMC support to MPlayer? ==
+
'''X-Video Motion Compensation (XvMC)''' is an extension for the X.Org Server. The XvMC API allows video programs to offload portions of the video decoding process to the GPU video-hardware. Particularly, features that have the tendency of heavily depending on the processor. Since XvMC acceleration takes the load off the CPU, thereby reducing processor requirements for video playback, it is an ideal solution for HDTV video playback scenarios.
<br>
+
{{Note|XvMC is obsoleted by [[VA-API]] nowadays, which have better support for recent GPUs.}}
Firstly, you need to open a terminal or command line window and log in with root permissions. So type:
+
<br>
+
<br>
+
su
+
...and enter your root password.
+
<br>
+
<br>
+
Next, you need to install the required dependencies. Type this:
+
<br>
+
<br>
+
pacman -S cvsup libxvmc unzip libcaca
+
<br>
+
'''cvsup''' is required for downloading the source and the ever important '''PKGBUILD''' file for ABS.<br>
+
'''libxvmc''' is the required library for compiling XvMC support.<br>
+
'''unzip''' is required during the build process. To uncompress required files called by '''PKGBUILD'''.<br>
+
'''libcaca''' is a dependency that is required for compiling MPlayer.<br>
+
<br>
+
The 2nd step is to sync your PC with Arch Linux's CVS. So type:
+
<br>
+
<br>
+
abs; cd /var/abs/extra/mplayer
+
<br>
+
Depending on your internet connection speed you may need to wait a while. When it finishes, it will point you to the '''/var/abs/extra/mplayer''' directory. (The location of where '''PKGBUILD''' file is.)
+
<br>
+
<br>
+
The 3rd step is to edit the '''PKGBUILD''' file to include XvMC support. '''PKGBUILD''' is basically a configuration file used by ABS to simplify with customization of source-based software in Arch Linux.<br>
+
<br>
+
Using your favourite text editor (using vim in this case), edit '''PKGBUILD'''. So type:
+
<br>
+
<br>
+
vim PKGBUILD
+
  
<br>
+
== Supported hardware ==
Now, you will see a bunch of scary stuff. Scroll down a bit, and you'll see the following:
+
<br>
+
<br>
+
depends=('libxxf86dga' 'libxv' 'libmad' 'libungif' 'cdparanoia' 'gtk2'\
+
        'codecs' 'sdl' 'lame' 'libtheora' 'ttf-bitstream-vera' 'xvidcore'\
+
        'libgl' 'smbclient' 'aalib' 'dbus-glib' 'jack-audio-connection-kit')
+
<br>
+
Add ''' 'libxvmc' ''' (press '''Insert''' to enter stuff in vim), such that it looks like this:
+
<br>
+
<br>
+
depends=('libxxf86dga' 'libxv' 'libmad' 'libungif' 'cdparanoia' 'gtk2'\
+
        'codecs' 'sdl' 'lame' 'libtheora' 'ttf-bitstream-vera' 'xvidcore'\
+
        'libgl' 'smbclient' 'aalib' 'dbus-glib' 'jack-audio-connection-kit'\
+
        ''''libxvmc'''')
+
<br>
+
What you've done here, is add the XvMC library to the dependency list.
+
<br>
+
<br>
+
Now scroll down a bit further until you encounter this:
+
<br>
+
<br>
+
  ./configure --prefix=/usr --enable-gui --disable-arts --enable-x11 \
+
      --enable-runtime-cpudetection --enable-sdl \
+
      --enable-theora --confdir=/etc/mplayer \
+
      --enable-xvid --enable-gl --enable-tv-v4l1 --enable-tv-v4l2 --enable-largefiles \
+
      --disable-liblzo --disable-speex --disable-openal --disable-faac \
+
      --enable-smb --enable-aa --disable-fribidi --disable-libdv --disable-musepack \
+
      --language=all --enable-lirc --disable-dvdnav --disable-esd $EXTRAOPTS
+
<br>
+
Add '''--enable-xvmc''' (press '''Insert''' to enter stuff in vim), such that it looks like this:
+
<br>
+
<br>
+
  ./configure --prefix=/usr --enable-gui --disable-arts --enable-x11 \
+
      --enable-runtime-cpudetection --enable-sdl \
+
      --enable-theora --confdir=/etc/mplayer \
+
      --enable-xvid --enable-gl --enable-tv-v4l1 --enable-tv-v4l2 --enable-largefiles \
+
      --disable-liblzo --disable-speex --disable-openal --disable-faac \
+
      --enable-smb --enable-aa --disable-fribidi --disable-libdv --disable-musepack \
+
      --language=all --enable-lirc --disable-dvdnav --disable-esd '''--enable-xvmc''' $EXTRAOPTS
+
<br>
+
Now press '''ESC''' to exit vim's '''INSERT''' mode. What you've done here, is add XvMC support when you compile MPlayer.
+
<br>
+
<br>
+
Save and exit out of the text editor. In vim, type:
+
<br>
+
<br>
+
:wq
+
<br>
+
The forth step is to compile MPlayer and build it into a Arch Linux package. Its easier than it sounds! :-) Just type:
+
<br>
+
<br>
+
makepkg
+
<br>
+
This is where you go off and do something else while it compiles and builds for you. Depending on the speed of your CPU, it will take a few minutes.
+
<br>
+
<br>
+
Once done, you'll end up with something like this on the screen:
+
<br>
+
<br>
+
==> Removing info/doc files...
+
==> Compressing man pages...
+
==> Stripping debugging symbols from libraries...
+
==> Stripping symbols from binaries...
+
==> Generating .PKGINFO file...
+
==> Copying install script...
+
==> Generating .FILELIST file...
+
==> Compressing package...
+
==> Finished making: mplayer  (Sun Jan 14 03:47:49 UTC 2007)
+
<br>
+
The fifth step is to install it! Type this:
+
<br>
+
<br>
+
pacman -U mplayer-1.0rc1-4.pkg.tar.gz
+
<br>
+
If its successful, it will look something like this:
+
<br>
+
<br>
+
loading package data... done.
+
checking for file conflicts... done.
+
installing mplayer... done.
+
==> mplayer now has optional lirc support, install lirc if you want to use it
+
<br>
+
The sixth step is to create a text file that points to the correct XvMC file in the Nvidia driver package, so type this:
+
<br>
+
<br>
+
vim /etc/X11/XvMCConfig
+
(vim will create a new file for you if one doesn't exist).
+
<br>
+
<br>
+
In this file, (press '''Insert''' first before typing in vim), add this:
+
<br>
+
<br>
+
libXvMCNVIDIA_dynamic.so.1
+
(This file is actually part of the proprietary Nvidia driver package!)
+
<br>
+
<br>
+
Press '''ESC''' to leave vim's '''Insert''' mode. Save and exit vim text editor. Type:
+
<br>
+
<br>
+
:wq
+
<br>
+
Exit out of root permissions. So type:
+
<br>
+
<br>
+
exit
+
<br>
+
The final step is to verify that MPlayer has XvMC support, so type:
+
<br>
+
<br>
+
mplayer -vo help
+
<br>
+
You will see a list of video output drivers. The one you want to see appearing in that list, is this:
+
<br>
+
<br>
+
xvmc    XVideo Motion Compensation
+
<br>
+
  
== How do I use MPlayer with XvMC enabled? ==
+
Only MPEG-1 and MPEG-2 videos are supported by all driver.
<br>
+
*[[NVIDIA]] GeForce 6 and GeForce 7 series cards are supported by the proprietary {{pkg|nvidia-304xx-utils}} package, available in the [[official repositories]].
You must use it via command line.
+
*NVIDIA GeForce 5 FX series cards are supported by the proprietary {{AUR|nvidia-173xx-utils}} package, available in the [[Arch User Repository]].
<br>
+
*NVIDIA GeForce4 series cards are supported by the proprietary {{AUR|nvidia-96xx-utils}} package, available in the [[Arch User Repository]].
<br>
+
*[[Intel]] 810, GMA 950, GMA 3100, GMA 3000, GMA 4500 series and Ironlake GPUs are supported by the open source {{pkg|xf86-video-intel}} package, available in the [[official repositories]].
'''EXAMPLE:''' Typing this will load up the video file '''foobar.mpeg''' with XvMC enabled.
+
*[[ATI Catalyst|AMD]] Radeon HD 5000 series and newer GPUs are supported by the proprietary {{pkg|catalyst-utils}} package, available in the [[official repositories]].
<br>
+
*AMD Radeon HD 4000 series GPUs are supported by the proprietary {{AUR|catalyst-legacy-utils}} package, available in the [[Arch User Repository]].
<br>
+
*[[Via Unichrome|S3 Graphics]] UniChrome GPUs are supported by the open source {{pkg|xf86-video-openchrome}} or {{pkg|xf86-video-unichrome}} packages, available in the [[official repositories]].
gmplayer -vo xvmc -vc ffmpeg12mc -fs foobar.mpeg
+
<br>
+
'''gmplayer''' => Loads up the GUI version of mplayer, whereas using '''mplayer''' does NOT. You can load either, depending on your needs.
+
  
'''-vo''' => video output. We tell MPlayer to use '''xmvc'''.
+
=== Configuration ===
  
'''-vc''' => video codec. We tell MPlayer to use '''ffmpeg12mc'''.
+
The open source drivers should work without any configuration. For the proprietary drivers create a new file {{ic|/etc/X11/XvMCConfig}} and add:
 +
*For NVIDIA GPUs:
 +
:{{bc|libXvMCNVIDIA_dynamic.so.1}}
 +
*For AMD GPUs:
 +
:{{bc|libAMDXvBA.so.1}}
 +
 
 +
== Supported software ==
 +
{{Tip|Using full screen mode and disabling GUI elements may prevent flickering while playing the video.}}
 +
 
 +
=== [[MPlayer]] ===
 +
Install {{pkg|mplayer}} package, available in the [[official repositories]].
 +
{{bc|$ mplayer -vo xvmc -fs ''foobar.mpeg''}}
 +
*'''-vo''' - Select xvmc video output driver
 +
*'''-fs''' - Fullscreen playback (optional)
 +
 
 +
MPlayer based players:
 +
* {{pkg|gnome-mplayer}}: open preferences and set the video output to "xvmc", and select "Enable Video Hardware Support".
 +
* {{pkg|smplayer}}: open preferences and set the video driver to "xvmc", and deselect "Enable screenshots".
 +
 
 +
=== xine ===
 +
Install {{pkg|xine-ui}} package, available in the [[official repositories]].
 +
{{bc|$ xine -V xvmc -f -g --no-splash ''foobar.mpeg''}}
 +
or
 +
{{bc|$ xine -V xxmc -f -g --no-splash ''foobar.mpeg''}}
 +
*'''-V''' - Select the xvmc or xxmc video driver
 +
*'''-f''' - Start in fullscreen mode (optional)
 +
*'''-g''' - Hide GUI (optional)
 +
*'''--no-splash''' - Don't display the splash screen (optional)
  
'''-fs => Use fullscreen mode.
 
<br>
 
<br>
 
For more options, just type '''mplayer -vo help''' in a terminal or command window.
 
<br>
 
<br>
 
'''REMEMBER: This only works with MPEG1 and MPEG2 files!'''
 
<br>
 
<br>
 
To test MPlayer with XvMC, head over here and download a video:
 
<br>
 
http://www.leadcodecs.com/Download/MPEG-Videos.htm
 
<br>
 
<br>
 
 
== References ==
 
== References ==
<br>
+
 
'''XvMC (from MythTV wiki)'''
+
*[http://www.mythtv.org/wiki/XvMC XvMC (from MythTV wiki)]
<br>
+
*[http://www.murga-linux.com/puppy/viewtopic.php?t=13216 MPlayer 1.0rc1 + XvMC Nov 2006]
http://www.mythtv.org/wiki/index.php/XvMC
+
*[http://www.penlug.org/twiki/bin/view/Main/LinuxHardwareInfoNvidia5200 Using older machines for HDTV video playback]
<br>
+
*[http://www.grogy.com/local_doc/share/doc/xine-lib/README_xxmc.html Xine's xxmc plugin]
<br>
+
'''MPlayer 1.0rc1 + XvMC Nov 2006'''
+
<br>
+
http://www.murga-linux.com/puppy/viewtopic.php?t=13216
+
<br>
+
<br>
+
'''Using older machines for HDTV video playback'''
+
<br>
+
http://www.penlug.org/twiki/bin/view/Main/LinuxHardwareInfoNvidia5200
+
<br>
+
<br>
+

Revision as of 11:58, 17 November 2012

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary end

X-Video Motion Compensation (XvMC) is an extension for the X.Org Server. The XvMC API allows video programs to offload portions of the video decoding process to the GPU video-hardware. Particularly, features that have the tendency of heavily depending on the processor. Since XvMC acceleration takes the load off the CPU, thereby reducing processor requirements for video playback, it is an ideal solution for HDTV video playback scenarios.

Note: XvMC is obsoleted by VA-API nowadays, which have better support for recent GPUs.

Supported hardware

Only MPEG-1 and MPEG-2 videos are supported by all driver.

Configuration

The open source drivers should work without any configuration. For the proprietary drivers create a new file /etc/X11/XvMCConfig and add:

  • For NVIDIA GPUs:
libXvMCNVIDIA_dynamic.so.1
  • For AMD GPUs:
libAMDXvBA.so.1

Supported software

Tip: Using full screen mode and disabling GUI elements may prevent flickering while playing the video.

MPlayer

Install mplayer package, available in the official repositories.

$ mplayer -vo xvmc -fs foobar.mpeg
  • -vo - Select xvmc video output driver
  • -fs - Fullscreen playback (optional)

MPlayer based players:

  • gnome-mplayer: open preferences and set the video output to "xvmc", and select "Enable Video Hardware Support".
  • smplayer: open preferences and set the video driver to "xvmc", and deselect "Enable screenshots".

xine

Install xine-ui package, available in the official repositories.

$ xine -V xvmc -f -g --no-splash foobar.mpeg

or

$ xine -V xxmc -f -g --no-splash foobar.mpeg
  • -V - Select the xvmc or xxmc video driver
  • -f - Start in fullscreen mode (optional)
  • -g - Hide GUI (optional)
  • --no-splash - Don't display the splash screen (optional)

References