Page 1 of 4 123 ... LastLast
Results 1 to 10 of 37

Thread: Howto: Build the svn MPlayer under the latest release version of Ubuntu

  1. #1
    Join Date
    Dec 2006
    Beans
    6,930

    Howto: Build the svn MPlayer under the latest release version of Ubuntu

    This guide details how to install the development version of MPlayer on the latest release version of Ubuntu Linux. It will be periodically updated to cover the latest Ubuntu version in a 'rolling release' fashion. I hope you enjoy this guide and profit by it, feel free to post any problems or discussion in the thread that follows.

    Preparation: Raring Ringtail...

    To start with some basic tools are required, and we will also setup our build directory:

    Code:
    sudo apt-get -y install build-essential subversion checkinstall git-core yasm \
    cmake docbook-xml docbook-xsl xsltproc libxml2-utils && \
    mkdir -pv $HOME/mplayer_build
    Next a considerable volume of interlinked development files are required, the following is a single command:

    Code:
    sudo apt-get -y install libaa1-dev libasound2-dev libcaca-dev libcdparanoia-dev libdca-dev \
    libdirectfb-dev libenca-dev libesd0-dev libfontconfig1-dev libfreetype6-dev \
    libfribidi-dev libgif-dev libgl1-mesa-dev libjack-jackd2-dev libopenal-dev libpulse-dev \
    libsdl1.2-dev libsvga1-dev libvdpau-dev libxinerama-dev libxv-dev libxvmc-dev libxxf86dga-dev \
    libxxf86vm-dev librtmp-dev libsctp-dev libass-dev libfaac-dev libsmbclient-dev libtheora-dev \
    libogg-dev libxvidcore-dev libspeex-dev libvpx-dev libschroedinger-dev libdirac-dev libdv4-dev \
    libopencore-amrnb-dev libopencore-amrwb-dev libmp3lame-dev libtwolame-dev \
    libmad0-dev libgsm1-dev libbs2b-dev liblzo2-dev ladspa-sdk libopenjpeg-dev libfaad-dev \
    libmpg123-dev libopus-dev libbluray-dev libaacs-dev libgtk2.0-dev
    Be a little wary of omitting any of these files as often a single file given here pulls in several more that are essential to a good MPlayer installation but feel free to add a few if required. With the basics done now we download some files external to the Ubuntu repositories:

    Codecs...

    MPlayer benefits from the use of some external codecs and these can be downloaded directly from the MPlayer website. The following is a single command:

    Code:
    cd $HOME/mplayer_build && \
    sudo mkdir -pv /usr/local/lib/codecs && \
    if [ "$(uname -m)" = "x86_64" ]; then
     wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
     tar xjvf essential-amd64-20071007.tar.bz2
     sudo cp -v essential-amd64-20071007/* /usr/local/lib/codecs
    else
     wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20110131.tar.bz2
     tar xjvf all-20110131.tar.bz2
     sudo cp -v all-20110131/* /usr/local/lib/codecs
    fi
    Bear in mind that codecs for 64 bit users are pretty minimal, the real benefits here are for the 32 bit users. There is a continuing drive to bring access to these file formats under the libavcodec umbrella so hopefully one day these codecs will no longer be necessary.

    Skins...

    There has been substantial work on the gui of MPlayer known as GMPlayer so once again this guide covers its installation. We download and install a couple of skins to experiment with:

    Code:
    mkdir -pv $HOME/.mplayer/skins/default && cd $HOME/mplayer_build && \
    wget ftp://ftp.mplayerhq.hu/MPlayer/skins/Clearlooks-1.5.tar.bz2 && \
    wget ftp://ftp.mplayerhq.hu/MPlayer/skins/Noskin-1.0.tar.bz2 && \
    wget ftp://ftp.mplayerhq.hu/MPlayer/skins/ICY-1.0.tar.bz2 && \
    tar -C $HOME/.mplayer/skins/default -xvf Clearlooks-1.5.tar.bz2 --strip-components=1 && \
    tar -C $HOME/.mplayer/skins -xvf Noskin-1.0.tar.bz2 && \
    tar -C $HOME/.mplayer/skins -xvf ICY-1.0.tar.bz2
    There are many more skins to experiment with but these three should provide at the very least a decent start.

    x264...

    The best encoder for h.264 video is x264, probably better used directly from the x264 commandline or even indirectly through FFmpeg. Nevertheless many people are still keen on MEncoder (several scripts and applications still use it, an example being h264enc) so the following single command installs a local copy of this great encoder's libraries for MEncoder to use.

    Code:
    if [ "$(uname -m)" = "x86_64" ]; then
      ARCHOPTS="--enable-pic"
     else
      ARCHOPTS=""
    fi && \
    cd $HOME/mplayer_build && \
    git clone git://git.videolan.org/x264.git --depth 1 && \
    cd x264 && \
    ./configure --prefix=$HOME/mplayer_build/mplayer_deps/usr \
                --enable-static --disable-cli $ARCHOPTS && \
    make && make install
    You could return to this section from time to time to update x264 by running git pull and then recompiling, and I would still recommend some experimentation with either FFmpeg or x264 for easier encoding.

    Optional extras...

    This section of the guide will have a few extra libraries not necessary but either interesting or just a bit of fun! Only item at the moment is a set of instructions for compiling the libraries for the Internet Low Bitrate Codec (iLBC).

    iLBC...

    MPlayer supports iLBC which is an open source royalty-free narrowband speech codec now developed by Google. The following single command downloads, compiles and installs the iLBC libraries:

    Code:
    cd $HOME/mplayer_build && git clone git://github.com/dekkers/libilbc.git --depth 1 && \
    cd $HOME/mplayer_build/libilbc && mkdir build && cd build && \
    sed -i_bak 's#/${CMAKE_LIBRARY_ARCHITECTURE}##g' ../CMakeLists.txt && \
    cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. && make && \
    mkdir -vp doc-pak && cp -v ../README doc-pak && \
    sudo checkinstall --pakdir "$HOME/mplayer_build" --backup=no --deldoc=yes \
                      --pkgname libilbc --pkgversion "1.1.1-git-$(date +%Y%m%d)" --fstrans=no \
                      --deldesc=yes --delspec=yes --default && \
    sudo ldconfig && cd .. && rm -rf $HOME/mplayer_build/libilbc/build && \
    mv CMakeLists.txt_bak CMakeLists.txt
    Still not the most common codec in the wild so I have placed a sample file here.

    Compiling MPlayer...

    Now to finally download and compile the svn MPlayer, bear in mind that you will be asked to also download the FFmpeg git source during this process which you should allow by pressing 'enter' when directed. The following is a single command:

    Code:
    cd $HOME/mplayer_build && \
    svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer && cd mplayer && \
    PKG_CONFIG_PATH="$HOME/mplayer_build/mplayer_deps/usr/lib/pkgconfig" \
    ./configure  --extra-cflags="-I$HOME/mplayer_build/mplayer_deps/usr/include" \
                 --extra-ldflags="-L$HOME/mplayer_build/mplayer_deps/usr/lib" \
                 --enable-gui --confdir=/etc/mplayer --codecsdir=/usr/local/lib/codecs && \
    make -j 2 && make html-chunked && \
    mkdir -vp doc-pak && \
    cp -v DOCS/HTML/*/* AUTHORS Changelog LICENSE README doc-pak && \
    sudo checkinstall -D --install=yes --fstrans=no --pakdir "$HOME/mplayer_build" \
       --pkgname mplayer --backup=no --deldoc=yes --deldesc=yes --delspec=yes --default \
       --pkgversion "2:1.0~svn$(LC_ALL=C svn info 2> /dev/null | \
         grep Revision | cut -d' ' -f2)" --provides "mplayer,mencoder" && \
    make distclean && sudo ldconfig
    And this is enough to get you a working copy of the great MPlayer! But it is a good idea to return from time to time and update your installation:

    Updating MPlayer...

    When you wish to update the svn MPlayer, as you definitely should do from time to time, the following single command will suffice:

    Code:
    cd $HOME/mplayer_build/mplayer && svn up && \
    PKG_CONFIG_PATH="$HOME/mplayer_build/mplayer_deps/usr/lib/pkgconfig" \
    ./configure --extra-cflags="-I$HOME/mplayer_build/mplayer_deps/usr/include" \
                 --extra-ldflags="-L$HOME/mplayer_build/mplayer_deps/usr/lib" \
                 --confdir=/etc/mplayer --enable-gui --codecsdir=/usr/local/lib/codecs && \
    make -j 2 && make html-chunked && \
    mkdir -vp doc-pak && \
    cp -v DOCS/HTML/*/* AUTHORS Changelog LICENSE README doc-pak && \
    sudo checkinstall -D --install=yes --fstrans=no --pakdir "$HOME/mplayer_build" \
       --pkgname mplayer --backup=no --deldoc=yes --deldesc=yes --delspec=yes --default \
       --pkgversion "2:1.0~svn$(LC_ALL=C svn info 2> /dev/null | \
         grep Revision | cut -d' ' -f2)" --provides "mplayer,mencoder" && \
    make distclean && sudo ldconfig
    This completes the setup for this guide and I wish you all the best with your continued exploration of this great media player!

    And in conclusion...

    Guide updates:

    * Jun 22: Removed liblivemedia-dev.
    * Jun 09: Added cmake to the setup files and libilbc in a new 'Optional' section.
    * May 29: Guide returns to the Forums
    Last edited by andrew.46; June 21st, 2013 at 10:50 PM.
    You think that's air you're breathing now?

  2. #2
    Join Date
    Dec 2006
    Beans
    6,930

    Re: Howto: Build the svn MPlayer under the latest release version of Ubuntu

    This guide has returned to the Forums, feels good to be back again! I have placed a 301 redirect from its temporary home on my website so there will be no duplication...
    You think that's air you're breathing now?

  3. #3
    Join Date
    Dec 2006
    Beans
    6,930

    Re: Howto: Build the svn MPlayer under the latest release version of Ubuntu

    This guide no longer includes instructions for SMPlayer but if you are interested perhaps use the developer's PPA:

    Code:
    sudo add-apt-repository ppa:rvm/smplayer
    sudo apt-get update
    sudo apt-get install smplayer smtube smplayer-themes smplayer-skins
    Most recent MPlayer successful compile:

    Code:
    andrew@ithaca:~$ mplayer | head -n 1
    MPlayer SVN-r36298-4.7 (C) 2000-2013 MPlayer Team
    You think that's air you're breathing now?

  4. #4
    Join Date
    Dec 2006
    Beans
    6,930

    Re: Howto: Build the svn MPlayer under the latest release version of Ubuntu

    I have added an optional section for the (now) open source speech codec iLBC. I have also placed a sample file:

    Code:
    wget *********************************/samples/luckynight.lbc
    I have to thank a certain bat for the inspiration for this one . MPlayer cannot find the shared library at the moment so this section remains a little broken until I can sort this out...
    You think that's air you're breathing now?

  5. #5
    Join Date
    Jun 2007
    Beans
    12,925

    Re: Howto: Build the svn MPlayer under the latest release version of Ubuntu

    Quote Originally Posted by andrew.46 View Post
    I have added an optional section for the (now) open source speech codec iLBC. I have also placed a sample file:

    Code:
    wget *********************************/samples/luckynight.lbc
    I have to thank a certain bat for the inspiration for this one . MPlayer cannot find the shared library at the moment so this section remains a little broken until I can sort this out...
    Where iLBC installs it's libs & what it defines in it's .pc aren't the same, maybe try adjusting one or the other

    mplayer would play if started with an env but's that's no 'solution'
    ex.
    Code:
    :~$ env LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu   mplayer  /home/doug/luckynight.lbc
    Creating config file: /home/doug/.mplayer/config
    MPlayer SVN-r36305-4.7 (C) 2000-2013 MPlayer Team
    mplayer: could not connect to socket
    mplayer: No such file or directory
    Failed to open LIRC support. You will not be able to use your remote control.
    
    Playing /home/doug/luckynight.lbc.
    libavformat version 55.8.102 (internal)
    libavformat file format detected.
    [ilbc @ 0x7f7e59624c60]max_analyze_duration 5000000 reached at 5000000 microseconds
    [ilbc @ 0x7f7e59624c60]Estimating duration from bitrate, this may be inaccurate
    [lavf] stream 0: audio (libilbc), -aid 0
    Load subtitles in /home/doug/
    ==========================================================================
    Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
    libavcodec version 55.15.100 (internal)
    AUDIO: 8000 Hz, 1 ch, s16le, 15.2 kbit/11.87% (ratio: 1900->16000)
    Selected audio codec: [libilbc] afm: ffmpeg (FFmpeg libilbc)
    ...ect.
    A symlink shows -

    Code:
     
    $ ldd /usr/local/bin/mplayer |grep ilbc
    	libilbc.so.1 => not found
    $ sudo ln -s /usr/local/lib/x86_64-linux-gnu/libilbc.so.1.1.1   /usr/local/lib/libilbc.so.1
    $ sudo ldconfig
    $ ldd /usr/local/bin/mplayer |grep ilbc
    	libilbc.so.1 => /usr/local/lib/libilbc.so.1 (0x00007f4196fc0000)
    Last edited by mc4man; June 9th, 2013 at 03:48 AM. Reason: linking

  6. #6
    Join Date
    Dec 2006
    Beans
    6,930

    Re: Howto: Build the svn MPlayer under the latest release version of Ubuntu

    Thanks again mc4man for looking at this! I have carved a little piece of the CMakeLists.txt away which I did not particularly like anyway:

    Code:
    cd $HOME/mplayer_build && git clone git://github.com/dekkers/libilbc.git --depth 1 && \
    cd $HOME/mplayer_build/libilbc && mkdir build && cd build && \
    sed -i_bak 's#/${CMAKE_LIBRARY_ARCHITECTURE}##g' ../CMakeLists.txt && \
    cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. && make && \
    mkdir -vp doc-pak && cp -v ../README doc-pak && \
    sudo checkinstall --pakdir "$HOME/mplayer_build" --backup=no --deldoc=yes \
                      --pkgname libilbc --pkgversion "1.1.1-git-$(date +%Y%m%d)" --fstrans=no \
                      --deldesc=yes --delspec=yes --default && \
    sudo ldconfig && cd .. && rm -rf $HOME/mplayer_build/libilbc/build && \
    mv CMakeLists.txt_bak CMakeLists.txt
    and restored it at the end for the sake of completion. It may not be the most elegant solution but it works well enough on this 32bit VM and I hope also on a 64bit system (I do not have a 64bit VM for MPlayer atm). I will probably revisit this over the next week and neaten things up a little. This is not the greatest CMakeLists.txt file, gave a few issues with 64bit/multilib slackware as well, but it could be that I am not the greatest user of cmake in the Linux world .

    Thanks again for taking the trouble...
    Last edited by andrew.46; June 9th, 2013 at 11:22 AM.
    You think that's air you're breathing now?

  7. #7
    Join Date
    Jun 2007
    Beans
    12,925

    Re: Howto: Build the svn MPlayer under the latest release version of Ubuntu

    I don't think the .pc matters much, at least with mplayer. More likely is mplayer doesn't link/search to /usr/local/lib/x86_64-linux-gnu or /usr/local/lib/i386-linux-gnu because it's not in the default ld search path

    So if using cmake if you could just install to /usr then mplayer should find the .so

    ie. - cmake -DCMAKE_INSTALL_PREFIX=/usr

    ldd for mplayer
    libilbc.so.1 => /usr/lib/x86_64-linux-gnu/libilbc.so.1

    Or add /usr/local/lib/x86_64-linux-gnu or /usr/local/lib/i386-linux-gnu to ld (/etc/ld.so.conf.d/*.conf
    The file to add to would depend on arch - ex. on amd64 shown in screen

    ldd for mplayer
    libilbc.so.1 => /usr/local/lib/x86_64-linux-gnu/libilbc.so.1

    I guess if wishing to keep with the newer install paths for multiarch then I'd say for guide just use /usr as install prefix


    ( the .pc could be corrected with this if it mattered in the CMakeLists.txt
    set(libdir "\${exec_prefix}/lib/${CMAKE_LIBRARY_ARCHITECTURE}")


    The source can also be built from a 'normal' ./configure (autoreconf -fiv then ./configure), that installs to /lib but oddly names the .so as libilbc.so.0.0.1
    Attached Images Attached Images

  8. #8
    Join Date
    Dec 2006
    Beans
    6,930

    Re: Howto: Build the svn MPlayer under the latest release version of Ubuntu

    Mind you how widespread is the use of multi-arch naming conventions in Ubuntu? The fact that these directories are not searched by default seems to me to be a sign that it is very much early days for this.
    Last edited by andrew.46; June 9th, 2013 at 08:20 PM.
    You think that's air you're breathing now?

  9. #9
    Join Date
    Jun 2007
    Beans
    12,925

    Re: Howto: Build the svn MPlayer under the latest release version of Ubuntu

    Quote Originally Posted by andrew.46 View Post
    Mind you how widespread is the use of multi-arch naming conventions in Ubuntu? The fact that these directories are not searched by default seems to me to be a sign that it is very much early days for this.
    It's actually quite common - take a look in /usr/lib/x86_64-linux-gnu or /usr/lib/i386-linux-gnu

    So /usr/lib/*-linux-gnu is now default enabled but /usr/local/lib/*-linux-gnu is not (from the distro standpoint no reason to do so

    Most sources/apps that need to do so will find/link to /usr/lib/*-linux-gnu, there was a recent ex. of where one didn't (python-nautilus), that was a case where it was using /usr/lib for i386 & /usr/lib64 for amd64, neither of which were correct. I wrote a couple of patches to fix that, applied to saucy, for 13.04 a ppa

    Anyway mplayer links to /usr/lib/*-linux-gnu just fine, can't to /usr/local/lib/*-linux-gnu because it's not 'enabled'

  10. #10
    Join Date
    Jun 2007
    Beans
    12,925

    Re: Howto: Build the svn MPlayer under the latest release version of Ubuntu

    Did libopenal1 need the -dev? (libopenal-dev

Page 1 of 4 123 ... LastLast

Tags for this Thread

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
  •