mplayer and vdpau in portage

I was hoping to write a lengthy post about VDPAU support for MPlayer in the portage tree, but since my harddrive crashed this week and I’m still recovering from that, a small announcement will have to suffice for now.

I just added a new ebuild to the tree this week for MPlayer, which has support for the much talked about VDPAU which comes with nvidia video cards and binary drivers.  If you don’t know what that is, it is probably most simply described as XvMC for more codecs: MPEG1, MPEG2, MPEG4 (H264), WMV, VC1.  The player offloads a lot of CPU decoding to the video card instead of your processor, meaning cheap video cards and cheap computers can playback HD without any hiccups.

In theory, at least.  I don’t know how well it works since I haven’t been able to test it much, and whenever I do, I can’t get it under 50% CPU anyway.

Anyway, you are free to try it of course.  The latest mplayer ebuild is 20090226.28734.  The naming scheme changed to reflect both the release date of the snapshot (Feb 26 2009) and the SVN revision from upstream (28734).  There is a “vdpau” use flag you’ll need to enable on the ebuild, and you’ll need  v180.22 or higher of nvidia-drivers.  In this case, nvidia is releasing updates with new drivers, so the more recent the better.

Here’s some cool stuff to read about VDPAU and what it can do:

NVIDIA 180.35 Driver Update Brings Changes

HD Video Playback With A $20 CPU & $30 GPU On Linux

Wikipedia entry

MythTV Wiki: Supported Cards

nvnews forum thread: mplayer and vdpau – see the third post for samples to test and mplayer command lines.

Oh yes, using it is pretty much a matter of mplayer -vo vdpau foo.wmv.  You may or may not need to use the -vc argument.  I haven’t looked closely.  See “mplayer -vc help | grep vdpau” for a reference, or the man page.

As far as the mplayer ebuild goes, there have been a lot of changes.  I’d been queuing them up for a good while waiting to push them live.  I had hoped to have a finished document accompany the release, but I haven’t given much time to it, and since VDPAU came out, I figured it would be better to release the ebuild.

It’s currently masked, but won’t be for long.  One nice thing it does is it splits up the real use flag into two: real and realcodecs.  I found that some users were confused and thought that they had to enable the realcodecs use flag to get any support for real codec playback, but that was never the case, as libavcodec always had support for some.  Now, the real flag will enable the internal support, and realcodecs will still use the external binary ones (not recommended).

Also, since libdvdnav got accepted into the mainstream build, we no longer have to rely on a masked, external dependency, so the dvdnav use flag is unmasked, available, and enabled by default.  You can playback DVDs browsing the navigation menus by using mplayer dvdnav:// instead of mplayer dvd://.

Other use flags that were added were faac, faad, and tremor.  If you want native support for AAC playback, just enable the aac use flag.  If you want to use the external libraries instead (faac and faad), then just disable the aac use flag and enable the other ones.  Tremor is the internal support for Vorbis playback.

The last change to the ebuild is that now lots more use flags are enabled by default.  I found out that a lot of people were going in #mplayer complaining that their builds weren’t working when really it was just not compiled with much in it.  As a result, I’ve changed it so it will enable just about every internal library and external codec.  That should make things simpler for users who want things to “just work” out of the box.

That’s it for now.  I’ll be bumping the ebuild again, soon, and regularly as long as the VDPAU development in mplayer keeps moving at a hectic pace.

About these ads

4 Comments

Filed under Gentoo, MPlayer

4 responses to “mplayer and vdpau in portage

  1. Rafael

    Well, I hope it works. I’ve not been able to use xvmc with mplayer until now, despite it working with Xine.

  2. Thanks for the links there. Makes me desire to build a media pc again.

  3. @Jeremy,

    Yah, I’d never considered building an HD media box until now.

    @Rafael,

    I’m hoping that I can eventually use this for normal DVD playback. Should handle it a lot better.

  4. laen

    I have actually tested it out with a beta nvidia driver supporting VDPAU, and an overlay build of mplayer with VDPAU support before.. Before, some 1080p video’s gave me 100% CPU usage at busy parts and hickups, on a Core 2 Duo T9300 with an Nvidia 8600M-GT. With VDPAU, CPU usage went to a constant 0% and the 1080p was _allways_ smooth and sexy. Crazy!

    I’m now waiting patiently for the mplayer w/ VDPAU to become stable, a 180* Nvidia driver w/ VDPAU to become stable, and the newer Xorg releases.. Then it’s indeed time to build a sexy lil media center or something.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s