Page 1 of 15 12311 ... LastLast
Results 1 to 10 of 144

Thread: Howto: Compile the development version of vlc under the latest Ubuntu release

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

    Howto: Compile the development version of vlc under the latest Ubuntu release

    This guide details how to install the development version of vlc using both 32 bit and 64 bit versions of the latest Ubuntu release, it owes a huge debt to the vlc Slackbuild of Eric Hameleers, otherwise known as alienBOB. This guide will be periodically updated for each new Ubuntu version.

    I emphasise at the outset that this development version of vlc will be broken at times and should only ever be installed by those willing to experiment a little, people who are used to running alpha or beta version software. The preferred method to build and test vlc-git is from within a Virtual Machine dedicated to this purpose alone, this is my own model in writing and testing this guide and I strongly recommend this method to all who follow the guide.

    Preparation: Trusty Tahr..

    As a first step it is a good idea to remove all previous vlc packages using either the Terminal, Synaptic or the Software Centre. Then some basic tools are required for compiling and we will also create the build location, the following is a single command which can simply be copied from here and pasted into a Terminal window:

    Code:
    sudo apt-get -y install build-essential git-core checkinstall \
    automake yasm cmake cmake-curses-gui && mkdir -pv $HOME/vlc_build
    A considerable volume of 'development' files is also required, the following is a single command:

    Code:
    sudo apt-get -y install liba52-0.7.4-dev libaa1-dev libasound2-dev libass-dev libavahi-client-dev libcaca-dev \
    libcairo2-dev libcddb2-dev libcdio-dev libdca-dev libdirac-dev libdvbpsi-dev libdvdnav-dev libdvdread-dev \
    libebml-dev libfaad-dev libflac-dev libfreetype6-dev libfribidi-dev libgcrypt11-dev \
    libgl1-mesa-dev libglib2.0-0 libgnutls28-dev libid3tag0-dev libjack-jackd2-dev \
    libkate-dev liblircclient-dev liblua5.1-0-dev libmad0-dev libmatroska-dev libmodplug-dev libmpcdec-dev \
    libmpeg2-4-dev libmtp-dev libncursesw5-dev libnotify-dev libogg-dev liboggkate-dev libpango1.0-dev \
    libpng12-dev libprojectm-dev libprojectm-qt-dev libproxy-dev libpulse-dev libqt4-dev libraw1394-dev \
    librsvg2-dev libschroedinger-dev libsdl-image1.2-dev libsdl1.2-dev libshout3-dev libsmbclient-dev \
    libspeex-dev libsqlite3-dev libsvga1-dev libsysfs-dev libtag1-dev libtar-dev libgme-dev libtheora-dev \
    libtool libtwolame-dev libudev-dev libupnp-dev libv4l-dev libvcdinfo-dev libvorbis-dev libva-dev \
    libvpx-dev libx11-dev libx11-xcb-dev libxcb-composite0-dev libxcb-keysyms1-dev libxcb-randr0-dev \
    libxcb-shm0-dev libxcb-xv0-dev libxcb-xvmc0-dev libxcb1-dev libxext-dev libxml2-dev libxpm-dev \
    libxt-dev libxv-dev libzvbi-dev lua5.1 qt4-qtconfig libspeexdsp-dev libsamplerate0-dev libvdpau-dev \
    libxpm-dev libxinerama-dev libtar-dev libgtk2.0-dev libdc1394-22-dev libopus-dev
    Feel free to experiment a little with these development files to match your needs but the ones given here will outfit you with a reasonably well equipped vlc. Now to add the libraries for fdk-aac which vlc will use (via FFmpeg) for aac encoding:

    libfdk-aac...

    libfdk-aac is in the Ubuntu Repositories but only version 1.2 and since 1.3 has some substantial fixes in place we will be compiling the newer version:

    Installing libfdk-aac:

    Code:
    if [ "$(uname -m)" = "x86_64" ]; then
      ARCHOPTS="--with-pic"
     else
      ARCHOPTS=""
    fi && \
    cd $HOME/vlc_build && wget https://github.com/mstorsjo/fdk-aac/archive/v0.1.3.tar.gz && \
    tar xvf v0.1.3.tar.gz && cd fdk-aac-0.1.3 && \
    autoreconf -fiv && \
    ./configure --prefix=$HOME/vlc_build/vlcdeps/usr \
                $ARCHOPTS \
                --disable-shared \
                --enable-static && \
    make && make install && make distclean
    Removing libfdk-aac:

    To remove all traces of libfdk-aac, including the installed libraries, the expanded source and the downloaded source archive use the following:

    Code:
    rm -rfv $HOME/vlc_build/vlcdeps/usr/include/fdk-aac && \
    rm -v $HOME/vlc_build/vlcdeps/usr/lib/libfdk-aac* && \
    rm -v $HOME/vlc_build/vlcdeps/usr/lib/pkgconfig/fdk-aac.pc && \
    rm -rfv $HOME/vlc_build/fdk-aac-0.1.3 && rm $HOME/vlc_build/v0.1.3.tar.gz
    Now by default vlc-git will use libfdk-aac (via FFmpeg) to produce all aac audio, producing very reasonable results according to my ears.

    FFmpeg...

    Next to install a local snapshot of the latest release version of FFmpeg which will avoid disturbing system settings of either avconv or FFmpeg..

    Installing FFmpeg:

    Code:
    sudo apt-get -y install libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev zlib1g-dev && \
    cd $HOME/vlc_build && \
    wget http://www.ffmpeg.org/releases/ffmpeg-2.2.4.tar.bz2 && \
    tar xvf ffmpeg-2.2.4.tar.bz2 && cd ffmpeg-2.2.4 && \
    if [ "$(uname -m)" = "x86_64" ]; then
      ARCHOPTS="--enable-pic"
     else
      ARCHOPTS=""
    fi && \
    CPPFLAGS="-I$HOME/vlc_build/vlcdeps/usr/include" \
    LDFLAGS="-L$HOME/vlc_build/vlcdeps/usr/lib" \
    PKG_CONFIG_PATH="$HOME/vlc_build/vlcdeps/usr/lib/pkgconfig" \
    ./configure --prefix=$HOME/vlc_build/vlcdeps/usr \
                $ARCHOPTS \
                --enable-gpl \
                --enable-version3 \
                --enable-nonfree \
                --enable-libmp3lame \
                --enable-libopencore-amrnb \
                --enable-libopencore-amrwb \
                --enable-libvpx \
                --enable-libfdk-aac \
                --disable-programs \
                --disable-doc \
                --disable-filters \
                --disable-avdevice \
                --disable-devices \
                --disable-avfilter \
                --disable-avresample && \
    make -j 2 && make install-libs install-headers && make distclean
    Removing FFmpeg:

    To remove the installed libraries, the expanded source and the original archived source use the following:

    Code:
    rm -rfv $HOME/vlc_build/vlcdeps/usr/include/{libav*,libpostproc,libsw*} && \
    rm -v $HOME/vlc_build/vlcdeps/usr/lib/{libav*.a,libpostproc.a,libsw*.a} && \
    rm -v $HOME/vlc_build/vlcdeps/usr/lib/pkgconfig/{libav*.pc,libpostproc.pc,libsw*.pc} && \
    rm -rfv $HOME/vlc_build/ffmpeg-*

    x264...

    Now for x264, we will a install a local copy of the latest x264 which vlc will use for directly transcoding to h.264 (it does not use FFmpeg for this). The use of a local copy is to avoid the mire of dependencies and conflicting version requirements involved with a system installation under Ubuntu.

    Installing x264:

    Code:
    if [ "$(uname -m)" = "x86_64" ]; then
      ARCHOPTS="--enable-pic"
     else
      ARCHOPTS=""
    fi && \
    cd $HOME/vlc_build && \
    git clone git://git.videolan.org/x264.git --depth 1 && \
    cd x264 && \
    ./configure --prefix=$HOME/vlc_build/vlcdeps/usr \
                --enable-static \
                --disable-cli \
                $ARCHOPTS && \
    make && make install
    Removing x264:

    Removing the installed files is reasonably straightforward and the following syntax should be enough:

    Code:
    rm -v $HOME/vlc_build/vlcdeps/usr/include/x264* && \
    rm -v $HOME/vlc_build/vlcdeps/usr/lib/libx264.a && \
    rm -v $HOME/vlc_build/vlcdeps/usr/lib/pkgconfig/x264.pc
    Updating x264:

    x264 is updated fairly regularly so I would suggest returning here from time to time and updating the libraries as follows:

    Code:
    if [ "$(uname -m)" = "x86_64" ]; then
      ARCHOPTS="--enable-pic"
     else
      ARCHOPTS=""
    fi && \
    cd $HOME/vlc_build/x264 && git pull && \
    ./configure --prefix=$HOME/vlc_build/vlcdeps/usr \
                --enable-static \
                --disable-cli \
                $ARCHOPTS && \
    make && make install
    Note that these instructions do not actually create an x264 executable, ask in the thread below if you wish to actually do this as well.

    libdvdcss...

    Medibuntu is gone, thanks for the years of work and dedication!! Rather than add a PPA (perhaps I am a troglodyte but I really don't like PPAs!) we will compile our own copy of libdvdcss so that DVD playback is possible. If laws in your country do not allow you to install libdvdcss omit the following single command:

    Code:
    cd $HOME/vlc_build && \
    sudo apt-get remove libdvdcss2 && \
    wget http://download.videolan.org/pub/libdvdcss/1.2.13/libdvdcss-1.2.13.tar.bz2 && \
    tar xvf libdvdcss-1.2.13.tar.bz2 && \
    cd libdvdcss-1.2.13 && \
    ./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/vlc_build" --backup=no --deldoc=yes \
                      --pkgname libdvdcss2 --pkgversion "1.2.13" --fstrans=no \
                      --deldesc=yes --delspec=yes --default && \
    make distclean && sudo ldconfig
    Now to install the live555 libraries:

    live555...

    vlc uses live555 for reading some streams and the following single command sets up a local copy following alienBOB's (and the vlc contrib rules.mak) syntax very closely this copy of live555 courtesy of the videolan servers.

    Installing live555:

    Code:
    cd $HOME/vlc_build && sudo apt-get -y remove liblivemedia-dev && \
    wget http://download.videolan.org/pub/contrib/live555/live.2014.05.27.tar.gz && \
    tar xvf live.2014.05.27.tar.gz && chmod -R u+w live && cd live && \
    if [ "$(uname -m)" = "x86_64" ]; then
      ./genMakefiles linux-64bit && make
    else 
      ./genMakefiles linux && make
     fi && \
    cp -v \
    groupsock/libgroupsock.a liveMedia/libliveMedia.a UsageEnvironment/libUsageEnvironment.a \
    BasicUsageEnvironment/libBasicUsageEnvironment.a $HOME/vlc_build/vlcdeps/usr/lib/ && \
    cp -v \
    groupsock/include/*.hh groupsock/include/*.h liveMedia/include/*.hh UsageEnvironment/include/*.hh \
    BasicUsageEnvironment/include/*.hh $HOME/vlc_build/vlcdeps/usr/include/
    Removing live555:

    The following removes the installed live555 libraries, the expanded source and the original archived source:

    Code:
    rm -v $HOME/vlc_build/vlcdeps/usr/include/{*.hh,NetCommon.h} && \
    rm -v $HOME/vlc_build/vlcdeps/usr/lib/{libgroupsock.a,libliveMedia.a,\
    libUsageEnvironment.a,libBasicUsageEnvironment.a} && \
    rm -rfv $HOME/vlc_build/live && \
    rm -v $HOME/vlc_build/live.*.tar.gz

    Building vlc-git..

    Finally we download the vlc-git source code and build it:

    Install vlc-git:

    Code:
    cd $HOME/vlc_build && git clone git://git.videolan.org/vlc.git --depth 1 && \
    cd $HOME/vlc_build/vlc && ./bootstrap && \
    CPPFLAGS="-I$HOME/vlc_build/vlcdeps/usr/include" \
    LDFLAGS="-L$HOME/vlc_build/vlcdeps/usr/lib" \
    PKG_CONFIG_PATH="$HOME/vlc_build/vlcdeps/usr/lib/pkgconfig" \
    ./configure --prefix=/usr/local && \
    make -j 2 && \
    mkdir -vp doc-pak && cp -v AUTHORS COPYING INSTALL NEWS README THANKS doc-pak && \
    sudo checkinstall --pakdir "$HOME/vlc_build" --backup=no --deldoc=yes --pkgname vlc \
                      --pkgversion "3.0.0-git~$(git rev-parse --short HEAD)" \
                      --fstrans=no --deldesc=yes --delspec=yes --default && \
    make distclean && sudo ldconfig
    And this should give you a working copy of vlc-git!

    Updating vlc-git...

    You should return from time to time to update your copy of vlc-git, the following single command will accomplish this:

    Code:
    cd $HOME/vlc_build/vlc && git pull && ./bootstrap && \
    CPPFLAGS="-I$HOME/vlc_build/vlcdeps/usr/include" \
    LDFLAGS="-L$HOME/vlc_build/vlcdeps/usr/lib" \
    PKG_CONFIG_PATH="$HOME/vlc_build/vlcdeps/usr/lib/pkgconfig" \
    ./configure --prefix=/usr/local && \
    make -j 2 && \
    mkdir -vp doc-pak && cp -v AUTHORS COPYING INSTALL NEWS README THANKS doc-pak && \
    sudo checkinstall --pakdir "$HOME/vlc_build" --backup=no --deldoc=yes --pkgname vlc \
                      --pkgversion "3.0.0-git~$(git rev-parse --short HEAD)" \
                      --fstrans=no --deldesc=yes --delspec=yes --default && \
    make distclean && sudo ldconfig
    This completes the setup of vlc-git for this guide and I wish you all the best with your continued exploration of the development version of this great media player! Please use the thread attached to this guide to make any suggestions or ask any questions...

    And in conclusion...

    Guide Updates:

    • Jun 30: Renamed fdk-aac to libfdk-aac where appropriate to avoid confusion with the command line encoder fdkaac...
    • Jun 27: Updated FFmpeg version to 2.2.4
    • Jun 15: A few more updates:
      1. Updated live555 libraries
      2. Changed vlc pkgversion to 3.0.0, a big welcome to Vetinari!!
      3. Fixed an embarrassing mistake in the live555 removal instruction, glad nobody saw it...
    • Jun 13: Updated FFmpeg version to 2.2.3
    • Apr 12: Updated FFmpeg version to 2.2.1
    • Apr 08: Trusty Tahr Updates:
      1. Updated the 'Development' files to suit Trusty
      2. Removed the fdk-aac commandline examples in the interest of simplifying the guide
      3. Again removed x265 compile examples
      4. Changed FFmpeg to latest release version
      5. Removed bluray material, this does not work in Virtual Machine anyway
      6. Compile instructions for libopus removed as Trusty version is sufficient now
      7. Removed skins instructions to keep focus on more central issues of this guide
      8. No longer compile release version as well, focus is on the development version
      9. Removed libfluidsynth instructions, this may be causing compile segfault
    Last edited by andrew.46; 1 Week Ago at 06:52 AM.
    You think that's air you're breathing now?

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

    Re: Howto: Compile the development version of vlc under the latest Ubuntu release

    It is good to have this guide back in 'Tutorials' again, I look forward to supporting this guide comprehensively as I did in the old days!! A very interesting vlc-git development that I bumped into when I edited this guide for Raring is the loss of access to the Windows codecs that was formerly made possible with the --enable-loader option:

    Code:
    + * Removed DLL loader for non-Windows Operating Systems
    A great pity but I guess the Windows codecs were becoming less useful, similar situation with MPlayer. Latest successful compile with this guide:

    Code:
    andrew@corinth:~$ vlc --version | head -n 3
    VLC media player 2.1.0-pre1 Rincewind (revision 64a5b8a)
    VLC version 2.1.0-pre1 Rincewind (64a5b8a)
    Compiled by andrew on corinth (May  4 2013 20:18:23)
    Compiler: gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)
    Last edited by andrew.46; May 4th, 2013 at 11:36 AM.
    You think that's air you're breathing now?

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

    Re: Howto: Compile the development version of vlc under the latest Ubuntu release

    Looks like I have some substantial catching up to do . I have added the appropriate dev files to support some of vlc's new abilities:

    1. Support for OPUS via libopus.
    2. Support for VDPAU hardware video decoding acceleration on Linux


    The vdpau support is a pretty big thing, should make the upcoming release very popular. Now to hunt down the following:

    Code:
    configure: WARNING: Skins2 interface disabled due to missing dependencies.
    Edit: Looks like libxpm-dev libxinerama-dev libtar-dev solved that one...
    Last edited by andrew.46; May 5th, 2013 at 02:48 AM.
    You think that's air you're breathing now?

  4. #4
    Join Date
    Jun 2007
    Beans
    12,909

    Re: Howto: Compile the development version of vlc under the latest Ubuntu release

    was going to say that the skins2 wasn't an issue here but see you caught the dep.
    Decided to let the build go on as per how-to go thru, built fine but during install see -
    /usr/bin/ld: /usr/local/lib/libx264.a(common.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
    Likely will be because of a still installed x264 package from typical FFmpeg build. Am currently rebuilding vlc with it removed to d. check.
    If so this isn't first occurrence a static build being used when it shouldn't
    (when I build aud plugins to /opt againt a shared, decoder only, FFmpeg that's built to /opt I have to first remove the FFmpeg build in /usr/local even with proper exports, ect.
    (options would include -
    removing x264* before build (if users only do a static x264 for a FFmpeg build then no use keeping installed
    If one has a current or so FFmpeg build with x264 package still installed then possibly? the x264 build could use --enable-pic & be usable with vlc also
    find a more 'absolute' way to export the pkgconfig/includes
    or
    fix something here?

    edit: 2nd build's install fails now on -
    /usr/bin/ld: /usr/local/lib/libvpx.a(vpx_codec.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
    Also from FFmpeg build - will give some thought ..

    Those are the only 2 here that cause an issue with as is vlc & ffmpeg guide builds, i'll probably just do all static builds out of path & inc., link ,ect as needed, could also move binaries or just run from install dir
    ( /opt/<whatever or $HOME/<whatever> , a one time set up there.
    Last edited by mc4man; May 5th, 2013 at 05:09 AM. Reason: de not en(coder, ect.

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

    Re: Howto: Compile the development version of vlc under the latest Ubuntu release

    I have perhaps not tested adequately here in that I have a VM dedicated solely to compiling vlc for this guide and thus I have no extra applications or duplicated applications installed.
    You think that's air you're breathing now?

  6. #6
    Join Date
    Jun 2007
    Beans
    12,909

    Re: Howto: Compile the development version of vlc under the latest Ubuntu release

    Well your guide is fine & the ffmpeg guide is fine, just thinking is there a way for both to co-exist. (on 64 bit), with both guides 'as is'

    Seems to be 4 sources/packages involved, ffmpeg; libopus; libvpx; (lib)x264

    libopus - a static build to /usr/local causes build failure on 'relocation..."
    libvpx - a static build to /usr/local causes install/linking error on 'relocation ...'
    x264 - a static build to /usr/local causes install/linking error on 'relocation ...'
    ffmpeg - a static build to /usr/local causes install/linking error on 'relocation ...'

    In the 3 cases of install/linking error, removing those packages just prior to install & all is well (ie. they're not used during the build

    Edit: out of the many solutions to using both guides decided for here to -
    keep the vlc one as is

    for ffmpeg went with the guide as is except for a couple of small changes,
    All sources use a --prefix=/opt/ffmpeg-current
    For the ffmpeg build added --bindir= /--mandir= /--datadir= options to install those files to appropriate places in /usr/local/ & all is well, both stay out of each others way, ect.

    (the only thing that drove me crazy for a bit was getting ffmpeg to find the other source builds in /opt/ffmpeg-current.
    LD_LIBRARY_PATH & PKG_CONFIG_PATH exports are useless, went with this which worked fine

    export C_INCLUDE_PATH=/opt/ffmpeg-current/include
    Last edited by mc4man; May 6th, 2013 at 12:13 AM.

  7. #7
    Join Date
    Sep 2006
    Beans
    3,470

    Re: Howto: Compile the development version of vlc under the latest Ubuntu release

    It is nice to see the return of this guide.

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

    Re: Howto: Compile the development version of vlc under the latest Ubuntu release

    Quote Originally Posted by FakeOutdoorsman View Post
    It is nice to see the return of this guide.
    It is good to be back .
    You think that's air you're breathing now?

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

    Re: Howto: Compile the development version of vlc under the latest Ubuntu release

    Quote Originally Posted by mc4man View Post

    Edit: out of the many solutions to using both guides decided for here to -
    keep the vlc one as is

    for ffmpeg went with the guide as is except for a couple of small changes.....
    And now all is well?
    You think that's air you're breathing now?

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

    Re: Howto: Compile the development version of vlc under the latest Ubuntu release

    Quote Originally Posted by andrew.46 View Post
    And now all is well?
    Yeah, if the static git versions of the mentioned sources have their includes & libs 'out of path' then when vlc is installed the linker doesn't use them.
    So the various source, .h, .pc, .a & .la files are in /opt/ffmpeg-current/*, ffmpeg binaries go to /usr/local/bin, the man, data files to /ust/local/share*, ect.
    If I was using x264 directly it could also go to /usr/local/bin.

    This is just one way to address, one could do any of several other approaches, from this guide only perspective I guess either just warn about to remove conflicting before the vlc install, (64 bit), or find a way to prevent when they do exist (I don't quite understand the install process, just can see what happens & what causes

    So just as an ex. of my 'new' ffmpeg configure - (for FO's guide
    Code:
    export C_INCLUDE_PATH=/opt/ffmpeg-current/include
    export LIBRARY_PATH=/opt/ffmpeg-current/lib
    export CPLUS_INCLUDE_PATH=/opt/ffmpeg-current/include 
    export PKG_CONFIG_PATH=/opt/ffmpeg-current/lib/pkgconfig
    
    ./configure --prefix=/opt/ffmpeg-current --bindir=/usr/local/bin --mandir=/usr/local/share/man \
    --datadir=/usr/local/share/ffmpeg  --enable-gpl --enable-libass --enable-libfaac \
    --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex \
    --enable-librtmp --enable-libtheora   --enable-libvorbis  --enable-x11grab --enable-libx264 \
    --enable-nonfree --enable-version3 --enable-libvpx --enable-libopus --enable-libfdk-aac
    edit; initially I also used this prior to ffmpeg configure but I don't think it mattered
    export LIBRARY_PATH=/opt/ffmpeg-current/lib
    Last edited by mc4man; May 8th, 2013 at 04:37 AM. Reason: expanded exports

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