VDPAU hardware accelerated decoding under Linux

I’ve recently done a little research on this and got a bit excited.
I’m currently running the beta 190.18 Nvidia driver on a 9600M GT card using the driver packages from here:

Running mplayer from the command line (couldn’t get it to work with the GUI version) I played back an H264 file that used about 40-60% CPU usage on one CPU without VDPAU, and a steady 3% CPU with VDPAU. This is a phenomenal improvement!

So I started looking into the possibly of hacking a VDPAU decoder for OF under Linux. I think it’s quite possible, but will need some time and patience. Right now not sure if I have either, but maybe later :slight_smile:

hey pierre

it seems the last gstreamer bad-plugins contains a pipeline element for vdpau:


i suppose with the custom pipeline capabilities in the new ofGstUtils, it should be easy to get this working, don’t know though how difficult will be to get a reference to a texture containing the frame.

i’m compiling the last bad plugins version and will give it a try… will let you know what happens :slight_smile:

Well, I found a few more posts related to this:


It seems like you can get the pixels from VDPAU by either using glCopyTexImage2D or GLX_texture_from_pixmap to create OpenGL textures, the latter being the fastest apparently. I’m not sure how that would integrate with GStreamer though…

Let me know how you go!

Hey pierre

i got it working with gstreamer, it’s a really experimental plugin, no documentation, and it only supports mpeg 1/2, no h264.

also i don’t get any performance improvements, both decoding in the cpu or the gpu takes about 30% of the cpu. the problem is the gstreamer plugin doesn’t render directly to an opengl texture, it does the decoding in the gpu, but then it has to decode the vdpau format to yuv (i think in the cpu) and again to rgb to reupload it again to the graphics card.

Does GStreamer VDPAU actually work at all in totem? The mplayer and VLC backends were actually developed by NVIDIA and then submitted as patches while GStreamer was left to develop it’s own VDPAU plugins. I haven’t yet seen any examples and yes this stuff is still highly experimental…the last few NVIDIA driver releases have included nothing but VDPAU bug fixes if that’s any indication.

I might have a hack at using ffmpeg to achieve the same thing…as that definitely works on my computer. I might have exaggerated the statistics above :wink: but I’m definitely seeing a 60-70% speedup in decoding times using H264.

no totem, doesn’t support it yet as you need to create a custom pipeline, i’ve tried with gst-launch and inside oF and non of them give better performance than the normal mpeg2dec

Digging up this thread, I just came across this article which points to accelerated video playback in GStreamer by the latter half of 2010!


This may be an OF issue but I think more likely GStreamer or V4L. I’m just wondering if anyone has encountered it also and knows a solution.

I’m doing some computer vision with OF on Ubuntu Karmic RT using a Trust webcam and I’ve noticed that CPU significantly increases when light conditions are brighter. On my machine at 30 fps 640 x 480 from about 30% to 60%.

Any ideas ? I wonder if anyone knows of a work around ? Will changing the brightness work ? OF doesn’t seem to let me directly access V4L to change this though ?