How to: Compile FFMPEG, FlvTool2 ... etc on Ubuntu and Debian

Status
Not open for further replies.

Medow7

Active Member
278
2011
34
1,500
Hello friends:

I am going to show you how you can compiled ffmpeg, flvtool2, mencoder and mplayer with all required codec on your Debian or Ubuntu dist.

After this your server will be fully supported for all kind of conversations including HTML5 formats support.

First let us be sure that server is clean from this applications:

Code:
apt-get remove ffmpeg x264 mencoder mplayer flvtool2
apt-get autoremove

Always be sure that you are on /usr/src to make your work organized:

Code:
cd /usr/src

I am using (nano as my editor) you can use it or use your favorite editor, and if you wanna install (nano) editor, fellow this:

Code:
apt-get install nano

then let us add extra repository to your repositories :

Code:
nano /etc/apt/sources.list

and add this line to the file:

Code:
deb http://archive.ubuntu.com/ubuntu natty main restricted universe multiverse

Notice that if you didn't have this line on your repositories, you will face issues on installing libfaac-dev.

Let us start the dirty work:

1. Installing some required packages:


Code:
apt-get update
apt-get upgrade
apt-get install make automake g++ bzip2 python unzip patch subversion ruby build-essential git-core checkinstall yasm texi2html libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvdpau-dev libvorbis-dev libvpx-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev

2. Installing x264:

Code:
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-shared
make && make install
cd ..

3. Installing libvpx:

Code:
wget http://webm.googlecode.com/files/libvpx-v0.9.7-p1.tar.bz2
tar xvjf ibvpx-v0.9.7-p1.tar.bz2
cd libvpx-v0.9.7-p1
./configure
make
make install
cd ..

4. Be sure these paths /usr/lib and /usr/local/lib exist in the file /etc/ld.so.conf:

Code:
nano /etc/ld.so.conf

and paste these lines on the file if they are not exist and save file:

Code:
/usr/lib
/usr/local/lib

then excute:

Code:
ldconfig

5. Installing FFMpeg:

Code:
git clone git://git.videolan.org/ffmpeg.git
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
make
make install
cd ..

6. IMPORTANT execute ldconfig :

Code:
ldconfig

7. Let us be sure these lines are exist on your repositories:

Code:
nano /etc/apt/sources.list

For Ubuntu:

Code:
deb http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ stable main
deb-src http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ stable main

For Debian Etch:

Code:
deb http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ etch main
deb-src http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ etch main

For Debian Lenny:

Code:
deb http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ lenny main
deb-src http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ lenny main

8. Updating packages:

Code:
apt-get update

9. Now let's install some basic packages. Existing packages will be updated or ignored:

Code:
apt-get install joe make automake g++ bzip2 python unzip patch subversion ruby

10. Installing the common codecs:

Code:
apt-get install libsdl1.2-dev zlib1g-dev libfaad-dev libfaac-dev libgsm1-dev libtheora-dev libvorbis-dev libxvidcore4-dev libspeex-dev

11. Installing the win codecs of the MPlayer vendor:

NOTE: on 32 bit systems install the codecs as follows:

Code:
wget http://www2.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
tar xvjf essential-20071007.tar.bz2
mkdir /usr/local/lib/codecs
cp -Rvp essential-20071007/* /usr/local/lib/codecs/

NOTE: on 64 bit systems install the codecs as follows:

Code:
wget http://www2.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
tar xvjf essential-amd64-20071007.tar.bz2
mkdir /usr/local/lib/codecs
cp -Rvp essential-amd64-20071007/* /usr/local/lib/codecs/

12.For jpeg output let's install the libjpeg libraries:

Code:
apt-get install libjpeg62 libjpeg62-dev

13. Then lame for mp3 encoding:

Code:
wget http://ovh.dl.sourceforge.net/sourceforge/lame/lame-398-2.tar.gz
tar xvzf lame-398-2.tar.gz
cd lame-398-2
./configure
make && make install
ldconfig
cd ..

14. 3gp support for mobile videos:

Code:
wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.1.tar.bz2
wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.2.tar.bz2
bzip2 -d amrnb-7.0.0.1.tar.bz2
bzip2 -d amrwb-7.0.0.2.tar.bz2
tar xvf amrnb-7.0.0.1.tar
tar xvf amrwb-7.0.0.2.tar
cd amrnb-7.0.0.1
./configure
make && make install
cd ..
cd amrwb-7.0.0.2
./configure
make && make install
ldconfig
cd ..

15. Installing MPlayer with Mencoder:

Code:
wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc4.tar.bz2
tar xvjf MPlayer-1.0rc4.tar.bz2
cd MPlayer-1.0rc4
./configure
make && make install
ldconfig
cd ..

16. Let us check if Mencoder is linked correctly:

Code:
ldd /usr/local/bin/mencoder | grep x264
ldd /usr/local/bin/mencoder | grep lame
ldd /usr/local/bin/mencoder | grep jpeg

The command line output should look as follows:

Code:
root:~# ldd /usr/local/bin/mencoder | grep x264
libx264.so.60 => /usr/local/lib/libx264.so.60 (0xb7f18000)
root:~# ldd /usr/local/bin/mencoder | grep lame
libmp3lame.so.0 => /usr/local/lib/libmp3lame.so.0 (0xb7e75000)
root:~# ldd /usr/local/bin/mencoder | grep jpeg
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0xb7e55000)

17. Installing Flvtool2:

Code:
apt-get install flvtool2

Now your system is fully supported for all media kinds.

And the paths are:

Code:
/usr/local/bin/ffmpeg
/usr/local/bin/mencoder
/usr/local/bin/mplayer
/usr/bin/flvtool2

Thank you for reading this .
 
5 comments
Thanks

Thanks

Hello friends:

I am going to show you how you can compiled ffmpeg, flvtool2, mencoder and mplayer with all required codec on your Debian or Ubuntu dist.

After this your server will be fully supported for all kind of conversations including HTML5 formats support.

First let us be sure that server is clean from this applications:

Code:
apt-get remove ffmpeg x264 mencoder mplayer flvtool2
apt-get autoremove

Always be sure that you are on /usr/src to make your work organized:

Code:
cd /usr/src

I am using (nano as my editor) you can use it or use your favorite editor, and if you wanna install (nano) editor, fellow this:

Code:
apt-get install nano

then let us add extra repository to your repositories :

Code:
nano /etc/apt/sources.list

and add this line to the file:

Code:
deb http://archive.ubuntu.com/ubuntu natty main restricted universe multiverse

Notice that if you didn't have this line on your repositories, you will face issues on installing libfaac-dev.

Let us start the dirty work:

1. Installing some required packages:


Code:
apt-get update
apt-get upgrade
apt-get install make automake g++ bzip2 python unzip patch subversion ruby build-essential git-core checkinstall yasm texi2html libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvdpau-dev libvorbis-dev libvpx-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev

2. Installing x264:

Code:
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-shared
make && make install
cd ..

3. Installing libvpx:

Code:
wget http://webm.googlecode.com/files/libvpx-v0.9.7-p1.tar.bz2
tar xvjf ibvpx-v0.9.7-p1.tar.bz2
cd libvpx-v0.9.7-p1
./configure
make
make install
cd ..

4. Be sure these paths /usr/lib and /usr/local/lib exist in the file /etc/ld.so.conf:

Code:
nano /etc/ld.so.conf

and paste these lines on the file if they are not exist and save file:

Code:
/usr/lib
/usr/local/lib

then excute:

Code:
ldconfig

5. Installing FFMpeg:

Code:
git clone git://git.videolan.org/ffmpeg.git
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
make
make install
cd ..

6. IMPORTANT execute ldconfig :

Code:
ldconfig

7. Let us be sure these lines are exist on your repositories:

Code:
nano /etc/apt/sources.list

For Ubuntu:

Code:
deb http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ stable main
deb-src http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ stable main

For Debian Etch:

Code:
deb http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ etch main
deb-src http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ etch main

For Debian Lenny:

Code:
deb http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ lenny main
deb-src http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ lenny main

8. Updating packages:

Code:
apt-get update

9. Now let's install some basic packages. Existing packages will be updated or ignored:

Code:
apt-get install joe make automake g++ bzip2 python unzip patch subversion ruby

10. Installing the common codecs:

Code:
apt-get install libsdl1.2-dev zlib1g-dev libfaad-dev libfaac-dev libgsm1-dev libtheora-dev libvorbis-dev libxvidcore4-dev libspeex-dev

11. Installing the win codecs of the MPlayer vendor:

NOTE: on 32 bit systems install the codecs as follows:

Code:
wget http://www2.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
tar xvjf essential-20071007.tar.bz2
mkdir /usr/local/lib/codecs
cp -Rvp essential-20071007/* /usr/local/lib/codecs/

NOTE: on 64 bit systems install the codecs as follows:

Code:
wget http://www2.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
tar xvjf essential-amd64-20071007.tar.bz2
mkdir /usr/local/lib/codecs
cp -Rvp essential-amd64-20071007/* /usr/local/lib/codecs/

12.For jpeg output let's install the libjpeg libraries:

Code:
apt-get install libjpeg62 libjpeg62-dev

13. Then lame for mp3 encoding:

Code:
wget http://ovh.dl.sourceforge.net/sourceforge/lame/lame-398-2.tar.gz
tar xvzf lame-398-2.tar.gz
cd lame-398-2
./configure
make && make install
ldconfig
cd ..

14. 3gp support for mobile videos:

Code:
wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.1.tar.bz2
wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.2.tar.bz2
bzip2 -d amrnb-7.0.0.1.tar.bz2
bzip2 -d amrwb-7.0.0.2.tar.bz2
tar xvf amrnb-7.0.0.1.tar
tar xvf amrwb-7.0.0.2.tar
cd amrnb-7.0.0.1
./configure
make && make install
cd ..
cd amrwb-7.0.0.2
./configure
make && make install
ldconfig
cd ..

15. Installing MPlayer with Mencoder:

Code:
wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc4.tar.bz2
tar xvjf MPlayer-1.0rc4.tar.bz2
cd MPlayer-1.0rc4
./configure
make && make install
ldconfig
cd ..

16. Let us check if Mencoder is linked correctly:

Code:
ldd /usr/local/bin/mencoder | grep x264
ldd /usr/local/bin/mencoder | grep lame
ldd /usr/local/bin/mencoder | grep jpeg

The command line output should look as follows:

Code:
root:~# ldd /usr/local/bin/mencoder | grep x264
libx264.so.60 => /usr/local/lib/libx264.so.60 (0xb7f18000)
root:~# ldd /usr/local/bin/mencoder | grep lame
libmp3lame.so.0 => /usr/local/lib/libmp3lame.so.0 (0xb7e75000)
root:~# ldd /usr/local/bin/mencoder | grep jpeg
libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0xb7e55000)

17. Installing Flvtool2:

Code:
apt-get install flvtool2

Now your system is fully supported for all media kinds.

And the paths are:

Code:
/usr/local/bin/ffmpeg
/usr/local/bin/mencoder
/usr/local/bin/mplayer
/usr/bin/flvtool2

Thank you for reading this .
 
Status
Not open for further replies.
Back
Top