Results 1 to 6 of 6

Thread: HOWTO: Recompiling MPlayer / MEncoder on (K)Ubuntu Breezy

  1. #1
    Join Date
    Apr 2005
    Location
    Galatina, LE - Italy
    Beans
    15
    Distro
    Kubuntu 7.04 Feisty Fawn

    HOWTO: Recompiling MPlayer / MEncoder on (K)Ubuntu Breezy

    HOWTO: Recompiling MPlayer / MEncoder on (K)Ubuntu Breezy

    I've tried installing all the different versions of MPlayer / MEncoder in my Breezy but I feel disappointed by the fact that these versions aren't compiled to use latest processor extensions (despite their name...). So I've googled around and managed to rebuild the MPlayer / MEncoder packages as described below. Furthermore, I've added the H.254 support by installing the open source x.264 codec library from VLC.


    1) Install development tools:


    Code:
    sudo apt-get install build-essentials
    sudo apt-get install devscripts
    sudo apt-get install subversion
    sudo apt-get install nasm
    Note that the subversion and nasm packages are needed to download and build x.264 sources from VLC repository. If you don't mind about it, you can skip subversion and nasm installation.


    2) Install x.264 codec (optional)

    Download latest SVN version from VLC repository:

    Code:
    svn co svn://svn.videolan.org/x264/trunk x264


    Build and install the codec with the following commands:

    Code:
    cd x264
    ./configure
    make
    sudo make install
    cd ..



    3) Download MPlayer sources with all needed dependencies

    MPlayer is in the multiverse section of Ubuntu repository, so please enable this section in the sources.list or directly in Synaptic. Then:

    Code:
    sudo apt-get source mplayer
    sudo apt-get build-dep mplayer



    4) Hacking debian/rules

    This is a quick-and-dirty tip to enable missing processor extensions in the MPlayer/MEncoder build.

    Code:
    cd mplayer-1.0-pre7cvs20050716/debian/
    vi rules


    Find and remove all the '--disable-xxx' options where xxx is in (mmx|mmx2|sse|sse2|3dnow|3dnow2). Don't mind about what your processor actually support. By removing all the '--disable-xxx' directives you force the MPlayer build to be tailored to your CPU.


    5) Building packages and install

    Now you can rebuild .deb packages of MPlayer and MEncoder by:

    Code:
    cd ..
    sudo debuild -us -uc
    At the end of the build you will find all the .deb packages produced in the parent directory.

    Code:
    cd ..
    sudo dpkg -i install mplayer-586*
    sudo dpkg -i install mencoder-586*


    Despite their name, as said before, mplayer and mencoder binaries now support all extensions of your CPU, as you can easily check by launching mplayer or mencoder without any parameter. On my Athlon 64 mencoder said:

    Code:
    MEncoder dev-CVS--4.0.2 (C) 2000-2005 MPlayer Team
    CPU: Advanced Micro Devices  (Family: 8, Stepping: 0)
    Detected cache-line size is 64 bytes
    CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
    Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2


    while on an Athlon XP:

    Code:
    MEncoder dev-CVS--4.0.2 (C) 2000-2005 MPlayer Team
    CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred (Family: 6, Stepping: 1)
    Detected cache-line size is 64 bytes
    CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
    Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE


    If you installed the x.264 codec before the mplayer building, you can check the codec presence in MEncoder by the following command:

    Code:
    mencoder -ovc help


    It should display, among others, the following line:

    Code:
       x264     - H.264 encoding


    That's all, folks....

    I hope this can help anyone that is 'optimization-fanatic' as I am.

    Bye.


  2. #2
    Join Date
    Nov 2005
    Location
    China
    Beans
    37
    Distro
    Ubuntu Breezy 5.10

    Re: HOWTO: Recompiling MPlayer / MEncoder on (K)Ubuntu Breezy

    THAT'S very helpful.Thanks
    Make it fun

  3. #3
    Join Date
    Aug 2005
    Location
    Tamworth, Australia
    Beans
    119
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Recompiling MPlayer / MEncoder on (K)Ubuntu Breezy

    Another satisfied customer!

    Cheers, dude, works great
    :: Do Not Click Here ::

    Code poet [My paradise is war]

  4. #4
    Join Date
    Feb 2006
    Location
    DC
    Beans
    323
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Recompiling MPlayer / MEncoder on (K)Ubuntu Breezy

    Is there an performance increase with this little mod?

  5. #5
    Join Date
    Mar 2006
    Beans
    2

    Re: HOWTO: Recompiling MPlayer / MEncoder on (K)Ubuntu Breezy

    I was skeptical that this might break mencoder working in acidrip because until the recent update it didn't work for me. It's going great though. On my computer it gave me, at the minimum, 50% faster speeds with Xvid so far on the second pass. The first pass I got an even better improvement. I'm a third of the way through the second pass. I'll edit the post if it doesn't work out but I've already tested a one pass encode so I doubt there's a problem. Anyhow THANKS!

    As you can see by my username, I don't know a lot unless it's spelled out for me. I got stuck in the how to at deleting all the --disable-xxx with vi rules because I didn't know how to save it. I figured out key combinations to get me backto the prompt but it didn't save it and it got old trying over and over to find the right key combo and google was no help so I just used sudo gedit which turned out to be easier too becuase I could use the search function for --disable and then just make sure it wasn't something other than the entrys I wanted.

    Also, I think the H.254 thing was already installed because it's what comes up default in the gui when I use gtranscode. Maybe not.. I'm not sure. I got an error on part of the installation of it in this guide though. I also got a bit of error messages when it came to making the deb packages but it is still working and my one pass has a little better detail, such as facial expression, than it did in the two pass before I did all the above so it's still worked out.

    Once again, thanks.

    Also, it took a really, really long time for the final part to do it's work. I thought perhaps I had edited that file wrong and that it was caught in a loop and almost closed the window. Maybe it would be a good idea to add that it takes a long time to build and is also building more than just one architecture because seeing the same things fly by a few times also had me scratchin my head during that part of the process.
    Last edited by DumbNoob; March 18th, 2006 at 11:25 PM.

  6. #6
    Join Date
    Nov 2005
    Beans
    31
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Recompiling MPlayer / MEncoder on (K)Ubuntu Breezy

    Hi All,

    I wanted to have Mencoder capable to use the x264 (in my opinion the best free codec at the moment), so I tried to apply the posted procedure. Here my experience:

    x264: the procedure of Amarra worked without any hickup, everything ok

    mplayer/mencoder: here things didn't go that easy...

    sudo apt-get source mplayer
    ok, no problems

    sudo apt-get build-dep mplayer
    here I receve the message that some dependency can't be satisfied. I tried to go on.

    cd mplayer-1.0-pre7cvs20050716/debian/
    vi rules

    made

    cd ..
    sudo debuild -us -uc

    first problem, some error message during building, I have been suggested to run debuild with -d option. The second trial gave me another error: missin GTK Devel... with Synapthic I installed the libgtk1.2-dev. I try againg

    sudo debuild -us -uc -d
    but after several minutes I get another error
    At this point I got nervous. Looking in the forum I found this post on the same topic:

    http://www.ubuntuforums.org/showthre...piling+mplayer

    so I decided to give it a trial.

    ./configure
    make

    and again error. I didn't have the permission to open some file. My nervous were like trings of violine... I tried to force the situation in not correct way:

    sudo make
    after several minutes I get an error: some file is missing. I opened the guilty source file and I found that the missing files were connected to some tremor, so I made

    ./congig --help
    and I found the option to disable this tremor.
    Again

    sudo make
    finally everything ok
    and then

    sudo make install

    and everything went fine.
    Anyway, I didn't want to spend to much time to understand what was wrong, it was too late in the night. My goal was to get mencoder and x264 working together and I accomplished it.

    My 2 cents, bye


    Elia

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
  •