W3Counter

How to install ffmpeg, Mplayer, mencoder,FLVtool2 and Yamdi on CentOS 5.4

December 7, 2009 | In: CentOS

This article shows how to install ffmpeg, ffmpeg-PHP, Mplayer, Mencoder, flv2tool, LAME MP3 Encoder, and Libog from source. It should work on most systems, however may need some tweaking from system to sytem.

We need to make sure the correct lib directories are setup in ldconfig. Edit the /etc/ld.so.conf file and add the following lines. After you save it, run the command ldconfig

nano /etc/ld.so.conf

/usr/local/lib
/usr/lib
ldconfig

Install Compiler

yum install gcc-c++

Some initial libraries

yum install libogg libogg-devel libvorbis zlib-devel libtool ruby subversion
rpm -ivh http://rpm.livna.org/livna-release.rpm

Faac

FAAC is an Advanced Audio Coder (MPEG2-AAC, MPEG4-AAC). The goal of FAAC is to explore the possibilities of AAC and exceed the quality of the currently best MP3 encoders.

wget http://downloads.sourceforge.net/project/faac/faac-src/faac-1.28/faac-1.28.tar.bz2?use_mirror=garr
tar jxf faac-1.28.tar.bz2
cd faac-1.28/
./bootstrap
./configure –enable-shared
make
make install
ldconfig

x264

x264 is a free library for encoding H264/AVC video streams.

wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20091203-2245.tar.bz2
tar jxf x264-snapshot-20091203-2245.tar.bz2
cd x264-snapshot-20091203-2245
./configure –enable-shared –disable-asm
make
make install
ldconfig

OpenJPEG

The OpenJPEG library is an open-source JPEG 2000 codec written in C language. It has been developed in order to promote the use of JPEG 2000, the new still-image compression standard from the Joint Photographic Experts Group (JPEG). In addition to the basic codec, various other features are under development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats, an indexing tool useful for the JPIP protocol, JPWL-tools for error-resilience, a Java-viewer for j2k-images, …

wget http://openjpeg.googlecode.com/files/openjpeg_v1_3.tar.gz
tar zxvf openjpeg_v1_3.tar.gz
cd OpenJPEG_v1_3
make
make install
ldconfig

LibTheora

Theora is a free and open video compression format from the Xiph.org Foundation. Like all our multimedia technology it can be used to distribute film and video online and on disc without the licensing and royalty fees or vendor lock-in associated with other formats. Theora scales from postage stamp to HD resolution, and is considered particularly competitive at low bitrates. It is in the same class as MPEG-4/DiVX, and like the Vorbis audio codec it has lots of room for improvement as encoder technology develops.

wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
tar zxvf libtheora-1.1.1.tar.gz
cd libtheora-1.1.1
./configure –enable-shared
make
make install

XVid

The Xvid video codec implements MPEG-4 Simple Profile and Advanced Simple Profile standards. It permits compressing and decompressing digital video in order to reduce the required bandwidth of video data for transmission over computer networks or efficient storage on CDs or DVDs. Due to its unrivalled quality Xvid has gained great popularity and is used in many other GPLed applications, like e.g. Transcode, MEncoder, MPlayer, Xine and many more.

wget http://downloads.xvid.org/downloads/xvidcore-1.2.2.tar.gz
tar zxvf xvidcore-1.2.2.tar.gz
cd xvidcore
cd build/generic
./configure –enable-shared
make
make 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

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/

Lame MP3 encoder

Pure install of FFmpeg is not enough, the FLV (Flash Video Files) converted has no audio, because FLV audio codec is mp3, so you need LAME support.

wget http://downloads.sourceforge.net/project/lame/lame/3.98.2/lame-398-2.tar.gz?use_mirror=garr
tar zxvf lame-398-2.tar.gz
cd lame-398-2
./configure –-enable-shared
make
make install

FLVTool2

FLVTool2 is a manipulation tool for Macromedia Flash Video files (FLV). It can calculate a lot of meta data, insert an onMetaData tag, cut FLV files, add cue points (onCuePoint), show the FLV structure and print meta data information in XML or YAML. Type flvtool2 in command line to see help after install succeed.

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

FFMPEG

FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec – the leading audio/video codec library.

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure –enable-libfaac –enable-shared –enable-memalign-hack –enable-gpl –enable-libtheora –enable-libmp3lame –enable-libopenjpeg –enable-libvorbis –enable-libx264 –enable-libxvid –enable-nonfree
make
make install

ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51

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. This works well for automatically creating thumbnail images from movies. ffmpeg-php is also useful for reporting the duration and bitrate of audio files (mp3, wma…). ffmpeg-php can access many of the video formats supported by ffmpeg (mov, avi, mpg, wmv…)

wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=garr
tar xjvf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0

Fix: With the latest version of ffmpeg-php (0.6.0), update ffmpeg_frame.c and replace every instance of PIX_FMT_RGBA32 with PIX_FMT_RGB32

vi ffmpeg_frame.c
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32
:w
:q!

./configure
make
make install
add extension=”ffmpeg.so” inside php.ini .

Mplayer & Codecs

MPlayer is a movie player which runs on many systems (see the documentation). It plays most MPEG/VOB, AVI, Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT, NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files, supported by many native, XAnim, and Win32 DLL codecs. You can watch VideoCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV and even H.264 movies.

wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
tar xjvf essential-20071007.tar.bz2
mv /usr/local/src/essential-20071007/ /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/

svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd mplayer
./configure
make
make install

[ad#Adsense]

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Add to favorites
  • Kirtsy
  • Live
  • MyShare
  • MySpace
  • RSS
  • StumbleUpon
  • Yahoo! Bookmarks
  • HackerNews
  • PDF
  • Slashdot
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter
  • Yahoo! Buzz

Comment Form

Categories

Sponsor

Get Adobe Flash playerPlugin by wpburn.com wordpress themes