WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] Mplayer & Hardware(GPU) Acceleration  (Read 17796 times)

Offline fodder

  • Newbie
  • *
  • Posts: 45
[SOLVED] Mplayer & Hardware(GPU) Acceleration
« on: February 01, 2013, 11:17:19 AM »
I am trying to get Mplayer to play high resolution H.264 video on a ZOTAC ZBOX-ID41-PLUS-U D525 R which uses an Nvidia Next Gen. ION.

Using an XBMCbuntu LiveCD, exiting to the OS, apt-getting Mplayer, and running "mplayer -vc ffh264vdpau test.mp4" it plays smooth as butter, so I know the hardware is compatible and I suspect I am just missing a step to get it working on Tiny Core.

Here is the typical setup I have tried:
  • Boot TinyCore 4.7.4 CD and exit to prompt.
  • tce-load -wi Xorg-7.5 nvidia-glx Mplayer-nodeps
  • Configure Xorg and Nvidia (per nvidia-glx.tcz.info), startx.
  • Open terminal and verify that glxgears runs perfectly.
  • Download test file: "wget -O - http://mydomain.com/test.mp4 > test.mp4"
  • "mplayer test.mp4" plays, but is very choppy.
  • "mplayer -vo help", no vdpau listed.
  • Try tons of combinations of -vo -vc but cannot get Mplayer to use the GPU.

I have verified that the Nvidia vdpau codecs are in /usr/local/lib/vdpau/ and that /home/tc/.mplayer/config is empty.

I have also tried Mplayer-xorg with the same results.

Any ideas or points in the right direction?

Thanks!
fodder

« Last Edit: February 05, 2013, 11:32:20 AM by fodder »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11027
Re: Mplayer & Hardware(GPU) Acceleration
« Reply #1 on: February 01, 2013, 11:18:42 AM »
I don't think any of our mplayer builds supports vdpau. -nodeps in particular not, since libvdpau would be an additional dep ;)
The only barriers that can stop you are the ones you create yourself.

Offline fodder

  • Newbie
  • *
  • Posts: 45
Re: Mplayer & Hardware(GPU) Acceleration
« Reply #2 on: February 01, 2013, 11:40:07 AM »
I don't think any of our mplayer builds supports vdpau. -nodeps in particular not, since libvdpau would be an additional dep ;)

Thanks for the quick reply curaga - sorry for my ignorance, I assumed that all the newer builds of Mplayer supported vdpau out-of-the-box as long as your display driver did, as well.  :-\

So, the comments for Mplayer-xorg say, "and other niceties to offload processing to your GPU".  Is there another mechanism, other than vdpau, that I can use to get hardware accelerated playback?   In all of my searching I only found references to vdpau and the much newer vaapi.
« Last Edit: February 01, 2013, 11:51:25 AM by fodder »

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Mplayer & Hardware(GPU) Acceleration
« Reply #3 on: February 01, 2013, 12:03:32 PM »
No. you'll have to recompile mplayer and perhaps also the right drivers.
I have an x200 with an intel gm45 decoder and it works with mplayer compiled against vaapi and a special driver. I can submit it if there's any interest, but sadly it only works fast enough with low bitrates. A 12Gigs fullhd movie is already too much.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11027
Re: Mplayer & Hardware(GPU) Acceleration
« Reply #4 on: February 01, 2013, 12:12:02 PM »
Quote
Thanks for the quick reply curaga - sorry for my ignorance, I assumed that all the newer builds of Mplayer supported vdpau out-of-the-box as long as your display driver did, as well.

They have to be new enough, and also be compiled to support it (and so depend on libvdpau).

Quote
So, the comments for Mplayer-xorg say, "and other niceties to offload processing to your GPU".  Is there another mechanism, other than vdpau, that I can use to get hardware accelerated playback?   In all of my searching I only found references to vdpau and the much newer vaapi.

It refers to XV, back then nodeps couldn't use it to play video.

It's like hiro says, you can build it yourself or request an extension update. But it can be hard to test that as only Nvidia cards support vdpau.
The only barriers that can stop you are the ones you create yourself.

Offline fodder

  • Newbie
  • *
  • Posts: 45
Re: Mplayer & Hardware(GPU) Acceleration
« Reply #5 on: February 04, 2013, 03:00:53 PM »
Thanks for you help so far curaga and hiro,

This is my first package to compile from source for Tiny Core, so please bear with me!

I am getting a make error that I suspect is due to not having the needed -dev files, but am at a loss as to how to find what I need.

Here are the steps I have taken:
  • Boot TinyCore 4.7.3 CD and exit to prompt.
  • tce-load -wi Xorg-7.5 nvidia-glx (configure, startx, and verify glxgears runs correctly)
  • tce-load -wil compiletc svn git yasm libvdpau-dev libx11-xcb
  • wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20110131.tar.bz2
  • tar xjvf all-20110131.tar.bz2
  • sudo mkdir /usr/local/lib/codecs
  • sudo cp -v all-20110131/* /usr/local/lib/codecs
  • svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
  • cd mplayer
  • ./configure --enable-vdpau
  • make install

The make fails with: /usr/local/include/X11/Xlib.h ... fatal error: X11/X.h: No such file or directory

I had a similar error, "X11/Xlib.h: No such...", that I was able to solve by installing libx11-xcb, so I am wondering if libx11-dev would have the missing file. But am unsure because other distro repos don't list it - for example: http://packages.ubuntu.com/quantal/i386/libx11-dev/filelist

Am I missing something obvious? Am I completely on the wrong track on something?

As always, any help would be greatly appreciated.

fodder
« Last Edit: February 04, 2013, 04:24:37 PM by fodder »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11518
Re: Mplayer & Hardware(GPU) Acceleration
« Reply #6 on: February 04, 2013, 03:34:10 PM »
Hi fodder
Quote
The make fails with: /usr/local/include/X11/Xlib.h ... fatal error: X11/X.h: No such file or directory

I had a similar error, "X11/Xlib.h: No such...", that I was able to solve by installing libx11-xcb, so I am wondering if libx11-dev would have the missing file. But am unsure because other distro repos don't list it - for example: http://packages.ubuntu.com/quantal/i386/libx11-dev/filelist
I think  Xorg-7.5-dev.tcz  would solve both those problems.

Offline AmatCoder

  • Full Member
  • ***
  • Posts: 179
    • AmatCoder Projects
Re: Mplayer & Hardware(GPU) Acceleration
« Reply #7 on: February 05, 2013, 02:10:46 AM »
(Sorry for noise)
If you get sucess then you also can try mplayer2...They claim: "Much better support for VDPAU functionality"
See: http://www.mplayer2.org/differences/

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11027
Re: Mplayer & Hardware(GPU) Acceleration
« Reply #8 on: February 05, 2013, 10:27:14 AM »
Yes, use Xorg-7.5-dev instead of x11-xcb.
The only barriers that can stop you are the ones you create yourself.

Offline fodder

  • Newbie
  • *
  • Posts: 45
Re: Mplayer & Hardware(GPU) Acceleration
« Reply #9 on: February 05, 2013, 11:31:14 AM »
Got it!  Thanks Rich and curaga, Xorg-7.5-dev was the last missing piece.

For anyone interested, here are the steps that worked for me:

  • Boot TinyCore 4.7.3 CD and exit to prompt.
  • tce-load -wi Xorg-7.5 nvidia-glx OSS (configure, startx, and verify glxgears runs correctly)
  • tce-load -wil compiletc svn git yasm Xorg-7.5-dev libvdpau-dev
  • wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20110131.tar.bz2
  • tar xjvf all-20110131.tar.bz2
  • sudo mkdir /usr/local/lib/codecs
  • sudo cp -v all-20110131/* /usr/local/lib/codecs
  • svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
  • cd mplayer
  • sudo ./configure --enable-vdpau
  • sudo make install

Now I get hardware accelerated video playback using: mplayer -vc ffh264vdpau test.mp4

My final step is now to compile it and create a reusable extension using tc-ext-tools.

AmatCoder, thanks for the suggestion. However, since it seems to be working fine for me with very high bitrate 1080p I think I am going to stick with MPlayer for now.  But if I run into any issues I will certainly try MPlayer2.

fodder

Offline fodder

  • Newbie
  • *
  • Posts: 45
Re: [SOLVED] Mplayer & Hardware(GPU) Acceleration
« Reply #10 on: February 20, 2013, 03:43:52 PM »
One more update to this topic - thought it might be helpful for others if I post the whole process, through creating the Tiny Core extension (tcz):

I ended up needing to get everything working using HDMI and couldn't figure out how to get OSS to use the HDMI audio channel so I compiled it with ALSA support in addition to VDPAU.

I also ended up just following the extension creation wiki (http://wiki.tinycorelinux.net/wiki:creating_extensions), minus the export flags step. (I tried it first using the export settings but MPlayer gave me a warning that it likes to set its own flags, and the resulting extension didn't work. Leaving them all out seems to work for me, but maybe someone more knowledgeable could chime in on if some of the flags could still be set for better compatibility.)

  • Boot TinyCore 4.7.4 CD and exit to prompt.
  • tce-load -wi Xorg-7.5 nvidia-glx alsa compiletc svn git yasm squashfs-tools-4.x Xorg-7.5-dev libvdpau-dev alsa-dev
  • sudo Xorg -configure
  • sudo mv /root/xorg.conf.new /etc/X11/xorg.conf
  • sudo nvidia-xconfig
  • startx and verify glxgears works.
  • wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20110131.tar.bz2
  • tar xjvf all-20110131.tar.bz2
  • sudo mkdir /usr/local/lib/codecs
  • sudo cp -v all-20110131/* /usr/local/lib/codecs
  • svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
  • cd mplayer
  • git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg (OPTIONAL)
  • ./configure --prefix=/usr/local --enable-vdpau --enable-alsa
  • make -j3
  • make DESTDIR=/tmp/mplayer install
  • cd /tmp
  • mksquashfs mplayer mplayer-xorg-vdpau-alsa.tcz

Using that extension I can now play smooth, high bitrate (40Mbps), 1080p video on my Zotec's HDMI port by invoking mplayer like this: mplayer -vc ffmpeg12vdpau,ffh264vdpau, -ao alsa:device=hdmi=NVidia.1 bluray_test.mp4

Note #1: I don't think the -ao option would be needed if you set HDMI out as the default in an /etc/asound.conf file.

Note #2: The downloaded codecs and ffmpeg are only compile dependencies - to use the new extension you need Xorg-7.5, nvidia-glx, alsa, and libvdpau installed.

fodder

Offline sebus

  • Jr. Member
  • **
  • Posts: 96
Re: [SOLVED] Mplayer & Hardware(GPU) Acceleration
« Reply #11 on: February 20, 2013, 04:12:02 PM »
That is not for Pure64, right?

sebus

Offline fodder

  • Newbie
  • *
  • Posts: 45
Re: [SOLVED] Mplayer & Hardware(GPU) Acceleration
« Reply #12 on: February 20, 2013, 04:16:53 PM »
That is not for Pure64, right?

sebus

Nope, it is for /4.x/x86/release/, sorry.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11027
Re: [SOLVED] Mplayer & Hardware(GPU) Acceleration
« Reply #13 on: February 20, 2013, 04:19:45 PM »
I don't think the codecs pack is needed if you don't use the old Windows codecs, could simplify that a bit.
The only barriers that can stop you are the ones you create yourself.

aus9

  • Guest
Re: [SOLVED] Mplayer & Hardware(GPU) Acceleration
« Reply #14 on: February 20, 2013, 06:43:58 PM »
glad its solved, we have ffmpeg packages but not under ffmpeg-dev but components

eg libavdevice-dev,    libavfilter-dev,    libavformat-dev, libavcodec-dev, libavutil-dev

suggest next time you build see if these help for building?

I gather our package vlc did not cut the mustard?