Page 1 of 7 123 ... LastLast
Results 1 to 10 of 66

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

  1. #1
    Join Date
    Dec 2006
    Beans
    7,349

    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: 14.04 LTS (Trusty Tahr)...

    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 yasm \
    git 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.

    DVD Playback...

    The various libraries involved in DVD playback have all moved beyond repository versions and the newest libdvdcss requires newer libdvdread at least, I will throw in the newest libdvdnav for free . First remove all of the older libraries:

    Code:
    sudo apt-get remove libdvdcss2 libdvdnav-dev libdvdnav4 libdvdread-dev libdvdread4
    and now install the newer libraries:

    libdvdcss...

    Install the latest libdvdcss with the following single command:

    Code:
    cd $HOME/mplayer_build && \
    wget http://download.videolan.org/pub/libdvdcss/1.3.0/libdvdcss-1.3.0.tar.bz2 && \
    tar xvf libdvdcss-1.3.0.tar.bz2 && \
    cd libdvdcss-1.3.0 && \
    ./configure --disable-doc \
                --docdir=/usr/share/doc/libdvdcss && make && \
    mkdir -vp doc-pak && cp -v AUTHORS ChangeLog COPYING INSTALL NEWS README doc-pak && \
    sudo checkinstall --pakdir "$HOME/mplayer_build" --backup=no --deldoc=yes \
                      --pkgname libdvdcss2 --pkgversion "1.3.0" --fstrans=no \
                      --deldesc=yes --delspec=yes --default && \
    make distclean && sudo ldconfig
    libdvdread...

    Install the latest libdvdread with the following single command:

    Code:
    cd $HOME/mplayer_build && \
    wget http://www.videolan.org/pub/videolan/libdvdread/5.0.0/libdvdread-5.0.0.tar.bz2 && \
    tar xvf libdvdread-5.0.0.tar.bz2 && \
    cd libdvdread-5.0.0 && \
    ./configure && make && \
    mkdir -vp doc-pak && cp -v AUTHORS ChangeLog COPYING NEWS README doc-pak && \
    sudo checkinstall --pakdir "$HOME/mplayer_build" --backup=no --deldoc=yes \
                      --pkgname libdvdread --pkgversion "5.0.0" --fstrans=no \
                      --deldesc=yes --delspec=yes --default && \
    make distclean && sudo ldconfig
    libdvdnav...


    Install the latest libdvdnav with the following single command:

    Code:
    cd $HOME/mplayer_build && \
    wget http://www.videolan.org/pub/videolan/libdvdnav/5.0.1/libdvdnav-5.0.1.tar.bz2 && \
    tar xvf libdvdnav-5.0.1.tar.bz2 && \
    cd libdvdnav-5.0.1 && \
    ./configure  && make && \
    mkdir -vp doc-pak && cp -v AUTHORS ChangeLog COPYING README TODO doc-pak && \
    sudo checkinstall --pakdir "$HOME/mplayer_build" --backup=no --deldoc=yes \
                      --pkgname libdvdnav --pkgversion "5.0.1" --fstrans=no \
                      --deldesc=yes --delspec=yes --default && \
    make distclean && sudo ldconfig
    And now to compile the MPlayer code:

    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 && \
    ./configure --disable-mencoder --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 "3:1.0~svn$(LC_ALL=C svn info 2> /dev/null | \
         grep Revision | cut -d' ' -f2)" && \
    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 && \
    ./configure --disable-mencoder --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 "3:1.0~svn$(LC_ALL=C svn info 2> /dev/null | \
         grep Revision | cut -d' ' -f2)" && \
    make distclean && sudo ldconfig
    Using a gui...

    Many will want a gui to use with MPlayer and still the best is SMPlayer, although there is competition around these days! I conquer my usual misgivings about PPAs and give the directions for RVM's PPA:

    Code:
    sudo add-apt-repository ppa:rvm/smplayer && \
    sudo apt-get update && \
    sudo apt-get install smplayer smtube smplayer-themes smplayer-skins
    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:

    * Dec 02: Added compile instructions for DVD libraries to sort out some incompatibilites.
    * Dec 01: Added the required libraries (libdvdread & libdvdnav) to allow dvd reading post MPlayer source changes.
    * Oct 11: Update for Trusty Tahr, removed MEncoder and GMPlayer, added SMPlayer.
    Last edited by andrew.46; December 2nd, 2014 at 09:21 AM.
    You think that's air you're breathing now?

  2. #2
    Join Date
    Dec 2006
    Beans
    7,349

    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
    7,349

    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
    7,349

    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 http://www.andrews-corner.org/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
    17,337

    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 http://www.andrews-corner.org/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
    7,349

    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
    17,337

    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
    7,349

    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
    17,337

    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
    17,337

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

    Did libopenal1 need the -dev? (libopenal-dev

Page 1 of 7 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
  •