Tuesday, September 4, 2007

Install FFMPEG on Linux

FFmpeg is a simple open source application that allows Linux users to convert video files easily between a variety of different formats. It supports most industry-standard codecs and can convert from one file format to another quickly and easily. It also lets you capture video and audio from a live source and process it.

Requirements:
FFMPEG
LAME Mp3 Audio Codec (Requred for mpg, flv, avi, wmv etc files)
AMR Audio Codec (Required for 3gp video files)
XVID Audio Codec (Required for Divx video files)
FFMPEG - PHP (Extension for using FFMPEG in PHP)

Note:
All the Audio Codecs getting used in FFMPEG are not part of FFMPEG Source base.
All the download files are source code will need to:
configure
make
make install

FFMPEG Download URL:
http://ffmpeg.mplayerhq.hu/download.html

On the download page apart from the SVN they have also given download to the checkout-snapshot but i would suggest to use SVN source code base.

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 for Linux located at subversion.tigris.org, or you can use "TortoiseSVN" for Windows located at tortoisesvn.tigris.org.

LAME Mp3 Download URL:
http://lame.sourceforge.net/index.php

AMR Audio Download URL:
http://www.penguin.cz/~utx/amr
To install the AMR codec you will require both AMR-WB and AMR-NB files.

XVID Audio Download URL:
http://www.xvid.org/

Installation Steps:
It is a good practice to install all the external liraries first and then install the main files. i.e. For FFMPEG to work smoothly it's a best practice to install all the Audio Codec Libraray first.

    Installing LAME MP3 Encoder
  • Untar the lame file bu using tar zxvf

  • Assign 777 permission rights to the lame folder by typing
    chmod 777 -R>

  • Traverse to the root of lame folder and type>
    Step1:
    ./configure ---> Creates Make File
    Step2:
    make
    Step3:
    make install


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 bu using tar zxvf

  • Assign 777 permission rights to the amr folder by typing
    chmod 777 -R

  • Traverse to the root of amr folder and type
    Step1:
    ./configure ---> Creates Make File
    Step2:
    make
    Step3:
    make install


    Installing Xvid Codec
  • Untar the xvid file bu using tar zxvf

  • Assign 777 permission rights to the lame folder by typing
    chmod 777 -R

  • Traverse to the root of xvid folder

  • Goto Build/generic folder from the root of xvid folder and type
    Step1:
    ./configure ---> Creates Make File
    Step2:
    make
    Step3:
    make install


Installing GCC
  • This is reqired as the SVN for FFMPEG is not compatible with the existing version of GCC(3x) requires a new version for the same. Installed GCC version 4.2

  • After the installation of GCC need to convert all the files of SVN to Unix compatible by using command "dos2unix".


    • Installing FFMPEG:
    • Unzip the ffmpeg file bu using unzip command in linux shell

    • Assign 777 permission rights to the ffmpeg folder by typing
      chmod 777 -R

    • Traverse to the root of ffmpeg folder and type
      Step1:
      ./configure ---> Creates Make File
      Step2:
      make
      Step3:
      make install


    NOTE:
    You might get installation error while making the file related to html or texti files in doc folder.
    Solution for this is to just create a empty file by using touch command.

    No comments: