Saturday, December 1, 2012

How to install the Multimedia package ( FFmpeg, flvtool2, facc....) in linux server ?

First, we have check whether the GNU C and C++ compilers and other development utilities installed or not. If not then install the utilites of it then only we can proceed to install the multimedia package.

RedHat/Centos: 

# yum groupinstall -y "Development Tools"

Debian/Ubuntu:

#apt-get install build-essential

Dynamic Linked Libraries Path:

Linux uses a system of shared libraries, similar to Windows dlls, for the efficient use of space and resources, and modularity. Add those below entry in  /etc/ld.so.conf

/usr/local/lib
/usr/lib

# ldconfig

LIBOGG:

Ogg is a free, open standard container format maintained by the Xiph.Org Foundation.

# cd /usr/local/src
# wget http://downloads.xiph.org/releases/ogg/libogg-1.2.2.tar.gz
# tar zxvf libogg-1.2.2.tar.gz
# cd /usr/local/src/libogg-1.2.2
#./configure && make clean && make && make install
# ldconfig

LIBVORBIS:

Ogg is a free, open standard container format maintained by the Xiph.Org Foundation.

# cd /usr/local/src
# wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.gz
# tar zxvf libvorbis-1.3.2.tar.gz
# cd /usr/local/src/libvorbis-1.3.2
# ./configure && make clean && make && make install

YASM:

Yasm is a software program that attempts to be a complete rewrite of the NASM assembler

# wget http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz
# tar zfvx yasm-1.1.0.tar.gz
# cd yasm-1.1.0
#  ./configure && make && make install

LIBX264:

x264 is a free software library for encoding video streams into the H.264/MPEG-4 AVC format. It is released under the terms of the GNU General Public License.

# cd /usr/local/src
# wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-`date -d "-1 days" +%Y%m%d`-2245-stable.tar.bz2
# tar jxf x264-snapshot-`date -d "-1 days" +%Y%m%d`-2245-stable.tar.bz2
# cd /usr/local/src/x264-snapshot-`date -d "-1 days" +%Y%m%d`-2245-stable
# ./configure --enable-shared && make clean && make && make install


AMR:

3GP is a simplified version of the MPEG-4 Part 14 (MP4) container format, designed to decrease storage and bandwidth requirements in order to accommodate mobile phones.

#cd /usr/local/src
# wget http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/0.1.2/opencore-amr-0.1.2.tar.gz
# tar zxf opencore-amr-0.1.2.tar.gz
# cd /usr/local/src/opencore-amr-0.1.2
# ./configure && make clean && make && make install

FAAC:

FAAC is an MPEG-4 and MPEG-2 AAC encoder.

# cd /usr/local/src
# wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gz
# tar zxvf faac-1.28.tar.gz
# cd /usr/local/src/faac-1.28
# ./configure && make clean && make && make install

In some server get the error  as "In file included from mp4common.h:29, from 3gp.cpp:28:mpeg4ip.h:126: error: new declaration ‘char* strcasestr(const char*, const char*)’" to sort out you have the file /usr/local/src/faac-1.28/common/mp4v2/mpeg4ip.h and remove the content " char *strcasestr(const char *haystack, const char *needle); " found in line 126

And then run #make clean && ./configure && make && make install

LAME:

LAME is an open source application used to encode audio into the MP3 file format.

# cd /usr/local/src
# wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz
# tar zxvf lame-3.98.4.tar.gz
# cd lame-3.98.4
# ./configure && make clean && make && make install

FLVTOOL2:

FLVTOOL2 can calculate a lot of meta data and insert a onMetaData tag. It can cut FLV files and add cue Points (onCuePoint).

# cd /usr/local/src
# wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
# tar zxvf flvtool2-1.0.6.tgz
# cd /usr/local/src/flvtool2-1.0.6/
# ruby setup.rb config && ruby setup.rb setup && ruby setup.rb install

YAMDI:

yamdi stands for Yet Another MetaData Injector and is a metadata injector for FLV files. It adds the onMetaData event to your FLV files. yamdi should run under *BSD, Linux and Win32

# cd /usr/local/src
# wget  "http://downloads.sourceforge.net/project/yamdi/yamdi/1.4/yamdi-1.4.tar.gz?use_mirror=garr"
# tar zxvf yamdi-1.4.tar.gz
# cd yamdi-1.4
# gcc yamdi.c -o yamdi -O2 -Wall  -D_FILE_OFFSET_BITS=647
# cp yamdi /usr/bin/

FFMPEG:

FFMPEG is a command line tool that is composed of a collection of free software / open source libraries. It includes libavcodec, an audio/video codec library used by several other projects, and libavformat, an audio/video container mux and demux library. The name of the project comes from the MPEG video standards group, together with "FF" for "fast forward".

# cd /usr/local/src
# mkdir /usr/local/src/tmp
# chmod 777 /usr/local/src/tmp
# export TMPDIR=/usr/local/src/tmp
# wget http://ffmpeg.org/releases/ffmpeg-0.7.11.tar.gz
# tar xzf ffmpeg-0.7.11.tar.gz
# cd ffmpeg-0.7.11
# make distclean
# ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-shared  --enable-libmp3lame --enable-libx264 --enable-libfaac  --enable-libvorbis --enable-libopencore-amrnb --enable-libopencore-amrwb
# make clean && make && make install
# make tools/qt-faststart
# cp tools/qt-faststart /usr/local/bin/
# ldconfig

MPLAYER (MENCODER):

MENCODER is a free command line video decoding, encoding and filtering tool released under the GNU General Public License.

# cd /usr/local/src
# wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20110131.tar.bz2
# tar jxvf all-20110131.tar.bz2
# mv /usr/local/src/all-20110131 /usr/local/lib/codecs/
# chmod -R 755 /usr/local/lib/codecs/
# mkdir /usr/local/src/tmp
# chmod 777 /usr/local/src/tmp
# export TMPDIR=/usr/local/src/tmp
# wget http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc4.tar.bz2
# tar jxf MPlayer-1.0rc4.tar.bz2
# cd MPlayer-1.0rc4
# make clean
#./configure && make && make install && ldconfig

FFMPEG-PHP:

FFMPEG-PHP is an extension for PHP that adds an easy to use, object-oriented API for accessing and retrieving information from video and audio files. It has methods for returning frames from movie files as images that can be manipulated using PHP's image functions.

# cd /usr/local/src
# wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2
# tar jxf ffmpeg-php-0.6.0.tbz2
# perl -i -p -e "s/PIX_FMT_RGBA32/PIX_FMT_RGBA/g;" ffmpeg_frame.c
# phpize
# ./configure && make clean && make && make install

Then add extension of ffmpeg in php.ini file

# echo "extension=ffmpeg.so" >> /etc/php.ini



No comments:

Post a Comment