Installing FFMPEG on Linux
FFMPEG is an open source application that allows you to convert video and audio files easily between a variety of different formats. It supports most industry-standard codec and can convert from one file format to another quickly and easily. This article will guide you to installing FFMPEG and other codec on Linux.
FFMPEG Installation Requirements:
- LAME Mp3 Audio Codec (Requred for mpg, flv, avi, wmv etc files)
- AMR Audio Codec (Required for 3gp video files)
- XVID Audio Codec
Note on installing FFMPEG:
- All the Audio Codec getting used in FFMPEG are not part of FFMPEG Source base
FFMPEG Download URL:
On the download page of FFMPEG they have geven the download link from SVN and checkout-snapshot but i would suggest to use SVN source code base.
FFMPEG Download Page FFMPEG
The url for the SVN source code for FFMPEG is: svn://svn.mplayerhq.hu/ffmpeg/trunk
To download from SVN you will have to install subversion located at subversion.tigris.org, or you can use “TortoiseSVN” located at tortoisesvn.tigris.org.
LAME Mp3 Codec download URL: Lame Mp3 Codec
AMR Audio Download URL: AMR Audio Codec
To install the AMR codec you will require both AMR-WB and AMR-NB files.
XVID Audio Download URL: XVID Audio Codec
FFMPEG-PHP Download URL: FFMPEG-PHP
It is a good practice to install all the external audio codec libraries first and then install the FFMPEG.
Installing LAME MP3 Encoder
- Untar the lame file by using tar zxvf lametarfile
- Assign 777 permission rights to the lame folder by typing chmod 777 lamefolder -R
- Traverse to the root of lame folder and type
Installing AMR Codec
For installing the AMR codec there are two separate files that needs to be installed are AMR-WB and AMR-NB.
- Untar the AMR file by using tar zxvf tarfile
- Assign 777 permission rights to the amr folder by typing chmod 777 amrfolder -R
- Traverse to the root of amr folder and type
Note on Installing AMR:
You might get errors installing AMR codec on Autoconf utility of linux. To resolve this problem will have to install the latest version of Autoconf utility from Download AutoConf
Installing Xvid Codec
- Untar the xvid file bu using tar zxvf tarfilename
- Assign 777 permission rights to the lame folder by typing chmod 777 xvidfolder -R
- Traverse to the root of xvid folder
- Goto Build/generic folder and type
- This is required only if the SVN for FFMPEG is not compatible with the existing version of GCC(3x) requires a new version for the same
- After the installation of GCC need to convert all the files of SVN to Unix compatible by using “dos2unix ffmpegfolder/* -R”.
- Download the ffmpeg from SVN
- Assign 777 permission rights to the ffmpeg folder by typing chmod 777 ffmepgfolder -R
- Traverse to the root of ffmpeg folder and type
./configure –enable-libmp3lame –enable-libogg –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared
- Download the ffmpeg-php from Sourceforge
- Unpack the archive by using following command “tar -xjf ffmpeg-php.X.XX.tar.gz”
- Iterate inside the ffmpeg-php directory
- Run phpize (included with your php install) to build configuration files
NOTE FOR FFMPEG-PHP:
If you are planning to install FFMPEG-PHP then will have to add –enable-shared parameter while configuring FFMPEG
You might get installation error while making the file related to html or texti files in ffmpeg\doc folder. The solution for this that worked for me is to just create a empty file by using touch command in the respective folders.
The following configure parameter will work with FFMPEG 0.49. But now the latest version does not have –enable-libogg parameter so if you are planning to installing the latest version then the configure parameter would be /configure –enable-libmp3lame –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared.
Note on Reinstalling FFMPEG:
If you are planning to reinstall the FFMPEG software the will have to perform following steps:
- ./configure –enable-libmp3lame –enable-libogg –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared
- make clean
- make install
Lot of people are facing error on loading shared libraries libavdevice.so.52, solution to the same is:
Still facing problem while installing leave a comment, will try my best to help you out.