Zakiir's Blog

May 4, 2010

FFMPEG installation

Filed under: php — zakiir @ 9:11 am
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:

    * FFMPEG
    * LAME Mp3 Audio Codec (Requred for mpg, flv, avi, wmv etc files)
    * AMR Audio Codec (Required for 3gp video files)
    * XVID Audio Codec
    * FFMPEG-PHP

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

Installation Steps:
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
      ./configure
      make
      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 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
      ./configure
      make
      make install

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
      ./configure
      make
      make install

Installing GCC

    * 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”.

Installing FFMPEG

    * 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-libvorbis --enable-libamr-nb --enable-libamr-wb --enable-libxvid --enable-gpl --enable-shared --enable-nonfree --enable-pthreads
      make
      make install

 Note:While installing FFMPEG u'll get error related to ulong.The Fix for this error is Below
     * Open /usr/include/linux/videodev.h file
     * search for ulong and replace it with unsigned long

Installing FFMPEG-PHP

    * 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
      ./configure
      make
      make install

Note:While installing FFMPEG-PHP u'll get error on ffmpeg_frame.c file.The fix is below
    * Open the File /usr/local/src/zakir/ffmpeg-php-0.6.0/ffmpeg_frame.c
    * Replace every instance of PIX_FMT_RGBA32 with PIX_FMT_RGB32


Note:Check below link for Your reference

http://www.eukhost.com/forums/f15/how-install-ffmpeg-ffmpeg-php-mplayer-mencoder-flv2tool-lame-mp3-encoder-4893/

Note:If you get error "Warning: Persistent movies have been disabled in php.ini" Then do the following
    * Include persistent for ffmpeg in php.ini
      ffmpeg. allow_persistent = on

About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: