Last Comment

Jon, Just run 'sudo ldconfig' ...

2012-11-27 @ 05:12:47 pm
by Admin


I get this after compileing trying ...

2012-11-27 @ 03:54:49 pm
by Jon


Nice article. That worked for me.

2012-11-27 @ 01:50:19 pm
by Arunroy


Calendar

May 2017
SunMonTueWedThuFriSat
 << < > >>
 123456
78910111213
14151617181920
21222324252627
28293031   

Who's Online?

Member: 0
Visitor: 1

Announce

Tags

No tags in this Blog

rss Syndication

Categories

Archives

Links

    Nov272012

    08:03:05 am

    Compiling FFmpeg on Ubuntu

    Supported OS: Ubuntu 12.10 (Quantal Quetzal), Ubuntu 12.04 (Precise Pangolin), and Ubuntu 11.10 (Oneiric Ocelot)

    Supported external libraries: libfaac, libmp3lame, libopencore-amrnb, libopencore-amrwb, libtheora, libvorbis, libvpx, libx264, avresample, libfdk-aac etc.

    Compilation on a New Ubuntu Box



    sudo apt-get update

    sudo apt-get install build-essential autoconf pkg-config libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libgpac-dev libvorbis-dev libtool zlib1g-dev texi2html yasm 

    The dependent libraries can be installed as follows,

    sudo apt-get build-dep ffmpeg

    sudo apt-get build-dep x264

    sudo apt-get build-dep libvpx


    The FFmpeg compilation on Ubuntu starts with the installation of x264 (H.264 encoder)

    Download the latest x264 code from the git repo,

    cd /home/user/code

    git clone --depth 1 git://git.videolan.org/x264

    cd x264

    ./configure --enable-shared

    make

    sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes --fstrans=no --default



    Next, install libvpx support for ffmpeg,

    cd /home/user/code

    git clone --depth 1 http://git.chromium.org/webm/libvpx.git

    cd libvpx

    ./configure

    make

    ‍sudo checkinstall --pkgname=libvpx --pkgversion="1:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default



    Once this is done, we can go ahead & install AAC audio encoder (fdk-aac)support for FFmpeg,

    cd /home/user/code

    git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git

    cd fdk-aac

    autoreconf -fiv

    ./configure --disable-shared

    make

    sudo checkinstall --pkgname=fdk-aac --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no -deldoc=yes --fstrans=no --default



    Since we are done with the supported libraries installation, we can compile FFmpeg,

    cd /home/user/code

    git clone --depth 1 git://source.ffmpeg.org/ffmpeg

    cd ffmpeg

    ./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 --enable-x11grab --enable-avresample --enable-libfdk-aac


    make

    sudo checkinstall --pkgname=ffmpeg --pkgversion="7:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default

    Compiling qt-faststart

    make tools/qt-faststart

    sudo checkinstall --pkgname=qt-faststart --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default install -Dm755 tools/qt-faststart  /usr/local/bin/qt-faststart


    Updating FFmpeg (on a machine where ffmpeg & all other libraries are installed)


    sudo apt-get update

    Now, start with x264,

    cd /home/user/code/x264

    make distclean

    make clean

    git pull

    Once you obtain the new code, update the x264 as follows,

    ./configure --enable-shared

    make ( if the make is giving any error, run the following commands,
               make uninstall
               make distclean
               make clean 
               ./configure --enable-shared)

    sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes --fstrans=no --default



    Now lets update libvpx,

    cd /home/user/code/libvpx

    make distclean

    make clean

    git pull

    ./configure

    make

    ‍sudo checkinstall --pkgname=libvpx --pkgversion="1:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default



    Next, update the fdk-aac,

    cd /home/user/code/fdk-aac

    make distclean

    make clean

    git pull

    autoreconf -fiv

    ./configure --disable-shared

    make

    sudo checkinstall --pkgname=fdk-aac --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no -deldoc=yes --fstrans=no --default



    Finally update ffmpeg,

    cd /home/user/code/ffmpeg/

    make distclean

    make clean

    git pull

    ./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 --enable-x11grab --enable-avresample --enable-libfdk-aac

    make

    sudo checkinstall --pkgname=ffmpeg --pkgversion="7:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default

    Update the qt-faststart,

    make tools/qt-faststart

    sudo checkinstall --pkgname=qt-faststart --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default install -Dm755 tools/qt-faststart  /usr/local/bin/qt-faststart

    Thats it....    :)

    Troubleshooting

    1) If the 'make' command on ffmpeg shows any error related to 'libx264.so', just uninstall libx264-dev package as follows,

    sudo apt-fet remove libx264-dev

    Now the 'make' commad will run successfully.

    2) If the command 'ffmpeg -v' shows any error afetr completing the compilation process, just run th following command,

    sudo ldconfig
    Then, try running the above command, it will give you the result without any failure.

    Admin · 8020 views · 3 comments
    Categories: Cat, Tech

    Permanent link to full entry

    http://jayaraj.sosblogs.com/My-Blogs-b1/Compiling-FFmpeg-on-Ubuntu-b1-p2.htm

    Comments

    Comment from: Admin [ Member ]
    Jon, Just run 'sudo ldconfig' & let me know. 

    Also try removing libx264-dev

    sudo apt-get remove libx264-dev
       2012-11-27 @ 05:12:47 pm
    Comment from: Jon [ Visitor ]
    I get this after compileing trying to run FFmpeg:

    ffmpeg: error while loading shared libraries: libx264.so.129: cannot open shared object file: No such file or directory

    Clean install of Ubuntu 12.10 Desktop (running headless)
       2012-11-27 @ 03:54:49 pm
    Comment from: Arunroy [ Visitor ]
    Nice article. That worked for me.
       2012-11-27 @ 01:50:19 pm

    Leave a comment

    New feedback status: Awaiting moderation





    Your URL will be displayed.


    Please enter the code written in the picture.


    Comment text

    Options
       (Set cookies for name, e-mail and url)