Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Howto: Speed up 720p or 1080p decoding using multithreaded mplayer

  1. #1
    Join Date
    Jan 2006
    Location
    Bristol, UK
    Beans
    275
    Distro
    Ubuntu 9.10 Karmic Koala

    Howto: Speed up 720p or 1080p decoding using multithreaded mplayer

    Hi all

    If you are like me, you may have tried to play some 720p or 1080p high definition H264 film clips on your computer and it has stuttered or lagged behind audio, making it unwatchable.

    Even very fast pcs suffer from this, for example a core 2 quad Q6600 @ 2.4Ghz will struggle with some 1080p material sometimes.

    There are two solutions to this problem:

    1. Use nvidia's new VDPAU acceleration architecture to speed up h264 decoding. If you have a 8xxx series or newer graphics card and use the proprietary nvidia drivers then it's a fair bet you can use this option.
    2. Use the latest multi-threaded branch of mplayer to try and speed up decoding. In my limited testing this has worked very well and gives massive speedups on dual core systems.


    If you have a nvidia card already, vdpau is your best bet, you can head over to this thread for a step by step howto.

    If you don't have a 8xxx series or high nvidia card, or don't want to use vdpau, the multi-threaded branch of ffmpeg is for you. I tried this on my core duo T2350@1.86Ghz laptop and I went from stuttering on 720p to perfectly smooth 1080p.

    Dependencies

    You will need to install mplayer's build dependencies and smplayer which is a nice frontend I like to use:

    Code:
    sudo apt-get build-dep mplayer && sudo aptitude install smplayer git-core
    Install

    Change to the src directory in your home folder. If you don't have one, create one:

    Code:
    mkdir ~/src && cd ~/src
    Get and build the latest multi-threaded branch of mplayer:

    Code:
    git clone git://repo.or.cz/mplayer && cd mplayer && git checkout origin/mt && git submodule init && git submodule update && ./configure && make
    The above method will not install mplayer to your system folders, so if it fails for some reason your old mplayer will work just fine. It also doesn't interfere with the package management system. You can of course install the multithreaded version to your system if you like using make install. You should be able to update the source to the latest upstream version by entering the mplayer directory and typing:

    Code:
    git pull origin mt
    Configure Smplayer

    Ok, the hard work is all done, now you just need to tell smplayer to use your new super fast mplayer version. Here is a list of configuration options you must change in smplayer:

    • General/General tab/Select MPlayer executable: Point this to your newly compiled mplayer version, if you followed this guide to the letter it should be /home/$user/src/mplayer/mplayer
    • General/General/Output drivers: You should make sure video is set to xv for best performance.
    • Performance/Performance: Loop filter - enabled at first, if movie plays slowly or stutters then you can disable this to improve performance at the expense of some quality. You should be able to leave this enabled on 2Ghz+ dual core systems
    • Advanced/Options for MPlayer/Options box: Enter the following line here:
      Code:
      -lavdopts threads=2


    That's it! Try playing a 1080p or 720p movie that your computer struggled with before. It should play perfectly well and you should be able to see that both cores are in use rather than just one as before. If your computer still struggles despite these enhancements then you can disable the loop deblocking filter in smplayer as detailed above, this should give you a large performance boost at the expense of quality.

    Bear in mind the multithreaded branch of ffmpeg is still experimental so some movies might fail to play. If you don't like using the new mplayer, you can easily tell smplayer to use the old reliable single threaded one instead by entering just "mplayer" in the mplayer executable box instead the path to your newly compiled one.

    Hope this helps someone!

    Sam
    Last edited by sammydee; April 3rd, 2009 at 01:40 PM.

  2. #2
    Join Date
    Apr 2008
    Beans
    7

    Re: Howto: Speed up 720p or 1080p decoding using multithreaded mplayer

    Cool!! I've been waiting so long for this.

    With fglrx driver i had to use gl2 video output to get rid of tearing.
    And it eats a lot of computing power.

    I had to decode videos with a 3.33GHz CPU.
    Now I can do it with a 2GHz CPU, and both cores' usage at ~70% rather than 1% and 100%.

    Thanks for sharing

  3. #3
    Join Date
    May 2008
    Beans
    1

    Re: Howto: Speed up 720p or 1080p decoding using multithreaded mplayer

    Thanks, great guide. Worked perfectly but for one thing:
    Code:
    sudo aptitude build-dep mplayer && sudo aptitude install smplayer git-core
    should be
    Code:
    sudo apt-get build-dep mplayer && sudo aptitude install smplayer git-core
    as it doesn't look like aptitude supports build-dep.

  4. #4
    Join Date
    Jan 2006
    Location
    Bristol, UK
    Beans
    275
    Distro
    Ubuntu 9.10 Karmic Koala

  5. #5
    Join Date
    Jan 2006
    Location
    Bristol, UK
    Beans
    275
    Distro
    Ubuntu 9.10 Karmic Koala

  6. #6
    Join Date
    Jan 2007
    Beans
    73
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Howto: Speed up 720p or 1080p decoding using multithreaded mplayer

    Thanks for the great guide
    Now i can watch 1080p without stuttering, even with loop filter enabled.
    It would be nice to see what other dependencies (dev packages) mplayer requires at compile time. configure also gives some list od disabled optional output drivers.
    Also, smplayer doesn't seem to recognize this version of mplayer, it asks on first start.
    Had to delete the smplayer config files and start from scratch since some things didn't work: subtitles, xv video output,...now it appears to work fine.
    Problem: newest version pulled from git doesn't compile:
    Code:
    libao2/ao_jack.o: In function `reset':
    ao_jack.c:(.text+0x1c6): undefined reference to `av_fifo_reset'
    libao2/ao_jack.o: In function `init':
    ao_jack.c:(.text+0x2ef): undefined reference to `av_fifo_alloc'
    libao2/ao_jack.o: In function `uninit':
    ao_jack.c:(.text+0x8ff): undefined reference to `av_fifo_reset'
    libao2/ao_sdl.o: In function `reset':
    ao_sdl.c:(.text+0x118): undefined reference to `av_fifo_reset'
    libao2/ao_sdl.o: In function `init':
    ao_sdl.c:(.text+0x14a): undefined reference to `av_fifo_alloc'
    collect2: ld returned 1 exit status
    make: *** [mplayer] Error 1
    Any ideas abut that?

  7. #7
    Join Date
    Oct 2004
    Location
    Northern California
    Beans
    92
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Howto: Speed up 720p or 1080p decoding using multithreaded mplayer

    Thanks! (Where did the 'Thank' button go?)

    Ubuntu Intrepid 8.10 64-bit
    Intel E8400 Core 2 Duo 3.0GHz
    Nvidia 6600GT
    2x2GB DDR2

    On this rig I was able to play 720p content without any issues using VLC, but playing 1080p content had extreme stutter and delay (unwatchable).

    The instructions mentioned in this thread have significantly improved the playback of 1080p content. Now viewing 1080p content (using SMplayer) is almost perfect, no more stuttering or delay, but I am seeing some artifacts, which I need to troubleshoot independently, but the instructions mentioned here got me 98% of the way there (on an under-capacity card no less). I've only tried 1 media source so far, and I haven't tried with the loop filter disabled yet.

    With 1080p content mplayer seems to hover in the 30-50% CPU range, and Xorg is 70%+ CPU (which I'm starting to wonder if the high Xorg CPU usage is not normal, and hence further troubleshooting).

    I was planning on stepping up to a 9800/260 soon anyway (to run a yet-to-be-purchased HDTV), but the instructions here should tide me over for a while (on my measly 22" Widescreen LCD monitor at 1680x1050).

    Thanks again!

  8. #8
    Join Date
    Nov 2005
    Location
    Israel
    Beans
    123
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Howto: Speed up 720p or 1080p decoding using multithreaded mplayer

    thanks for the howto, but I cant install it:
    when I am running the command
    Code:
    git clone git://repo.or.cz/mplayer
    after few seconds its start to download I get
    fatal: The remote end hung up unexpectedly.
    fatal: early EOF
    fatal: index-pack failed

    please help.
    thanks.

  9. #9
    Join Date
    Jan 2006
    Location
    Bristol, UK
    Beans
    275
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Howto: Speed up 720p or 1080p decoding using multithreaded mplayer

    Seeing as this is an experimental branch of mplayer, it is likely to be fairly buggy and sometimes even fail to compile.

    SOME1:

    It looks as though the site is just down temporarily.

    Sam

  10. #10
    Join Date
    Jan 2006
    Location
    Bristol, UK
    Beans
    275
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Howto: Speed up 720p or 1080p decoding using multithreaded mplayer

    Quote Originally Posted by chapterthree View Post
    With 1080p content mplayer seems to hover in the 30-50% CPU range, and Xorg is 70%+ CPU (which I'm starting to wonder if the high Xorg CPU usage is not normal, and hence further troubleshooting).
    Are you definately using xv? If compiz is enabled, are you definately using direct rendering (not indirect rendering)?

    Sam

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •