Board index Linux Installation Stuffs

Moderator: chandranjoy

FFMpeg Installation Steps

Postby chandranjoy » Fri Apr 09, 2010 4:53 am

FFMPEG Installation:

http://www.saiweb.co.uk/linux/ffmpeg-in ... bx264-h264

Install libx264:

Code: Select all
wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20100330-2245.tar.bz2
tar -xvjf x264-snapshot-20100330-2245.tar.bz2
cd x264-snapshot-20100330-2245
./configure --enable-shared
make
make install
ldconfig


Install FFMPEG:

#svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
#cd ffmpeg
#./configure --enable-libx264 -–enable-gpl -–enable-shared

Note: Before start to install ffmpeg with above mentioned libs/tools you must install them.
#make

#make install


Error:

error while loading shared libraries:libavdevice.so.52: cannot open shared object file: No such file or directory

To fix this:
vi /etc/ld.so.conf.d/custom-libs.conf


Add the line :/usr/local/lib

And run ldconfig.

To check the ffmpeg
#ffmpeg


Convert commands:
=================

video file to jpg:
ffmpeg -itsoffset -15 -i 'file_4bac6a2edd175.wmv' -vcodec mjpeg -vframes 1 -an -f rawvideo -s '320x240' '05.jpg'


video file to mp4:
ffmpeg -i 'video.flv' -acodec 'libmp3lame' -ab 128k -vcodec 'libx264' -vpre hq -crf 22 -threads 0 -f mp4 libx264_new.mp4



Install MP4Box Steps:

http://ubuntuforums.org/archive/index.p ... 15281.html

wget http://superb-east.dl.sourceforge.net/s ... 4.5.tar.gz
wget http://voxel.dl.sourceforge.net/sourcef ... 4.5.tar.gz
tar -zxf gpac-0.4.5.tar.gz
tar -zxf gpac_extra_libs-0.4.5.tar.gz
cd gpac_extra_libs
cp -r * ../gpac/extra_lib
cd ../gpac
chmod +x configure
./configure --disable-opengl --use-js=no --use-ft=no --use-jpeg=no --use-png=no --use-faad=no --use-mad=no --use-xvid=no --use-ffmpeg=no --use-ogg=no --use-vorbis=no --use-theora=no --use-openjpeg=no
make lib
make apps
make install-lib
make install
cp ./bin/gcc/libgpac.so /usr/lib/


Convert command:
===============
MP4Box -inter 0.2 -add /var/www/vhosts/thecomeup.tv/httpdocs/new_test/file_4bbbb0a670312.mp4 /var/www/vhosts/thecomeup.tv/httpdocs/videos/file_4bbbb0a670312_conv.mp4


Output:
[root@238359-web1 new_test]# /usr/local/bin/MP4Box -inter 0.2 -add /var/www/vhosts/thecomeup.tv/httpdocs/new_test/file_4bbbb0a670312.mp4 /var/www/vhosts/thecomeup.tv/httpdocs/videos/file_4bbbb0a670312_conv.mp4
IsoMedia import - track ID 1 - Video (size 896 x 496)
IsoMedia import - track ID 2 - Audio (SR 44100 - 2 channels)
Saving to /var/www/vhosts/thecomeup.tv/httpdocs/videos/file_4bbbb0a670312_conv.mp4: 0.000 secs Interleaving



FFmpeg, FFmpeg-PHP, Lame, Libogg, Libvorbis, FLVtool2, Mplayer, Mencoder, AMR Manual Installation:

Introduction

The following HOWTO will show you exactly how to install the following packages on a Debian Etch or Ubuntu 7.06 system:

* FFmpeg
* FFmpeg-PHP
* Mplayer + Mencoder
* flv2tool
* LAME MP3 Encoder
* AMR (for 3gp file conversions)
* Libogg
* Libvorbis

Do some prep-work

yum update
yum upgrade
yum install libjpeg-progs libjpeg62 libjpeg62-dev libsdl1.2-dev php5-dev build-essential unzip


Download all the files needed

cd /usr/local/src
Mplayer:
wget http://www3.mplayerhq.hu/MPlayer/releas ... rc3.tar.gz
Flvtool2:
wget http://rubyforge.org/frs/download.php/1 ... -1.0.6.tgz
MP3Lame:
wget http://sourceforge.net/projects/lame/fi ... z/download
FFMPEG-PHP:
wget http://sourceforge.net/projects/ffmpeg- ... 2/download
Or Try with SVN checkout: svn co https://ffmpeg-php.svn.sourceforge.net/ ... ffmpeg-php ffmpeg-php
Libogg:
wget http://downloads.xiph.org/releases/ogg/ ... 2.2.tar.gz
Libvorbis:
wget http://downloads.xiph.org/releases/vorb ... 3.2.tar.gz
Libtheora:
wget http://downloads.xiph.org/releases/theo ... .1.tar.bz2
Libxspf:
http://downloads.xiph.org/releases/xspf ... 2.0.tar.gz
Amrnb:
wget http://ftp.penguin.cz/pub/users/utx/amr ... .2.tar.bz2
Amrwb:
wget http://ftp.penguin.cz/pub/users/utx/amr ... .3.tar.bz2
Codecs:
http://www.mplayerhq.hu/MPlayer/releases/codecs/
Xvid:
wget http://downloads.xvid.org/downloads/xvi ... 2.2.tar.gz
Faad:
wget http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz
Faac:
http://downloads.sourceforge.net/faac/faac-1.28.tar.gz


Extract all the files

tar zxvf MPlayer-1.0rc3.tar.gz
tar zxvf flvtool2-1.0.6.tgz
tar zxvf lame-3.98.4.tar.gz
tar xjvf ffmpeg-php-0.6.0.tbz2
tar jxvf essential-20071007.tar.bz2
tar jxvf libogg-1.2.2.tar.gz
bzip2 -cd amrnb-7.0.0.2.tar.bz2 | tar xvf -
bzip2 -cd amrwb-7.0.0.3.tar.bz2 | tar xvf -
tar xvzf libtheora-1.1.1.tar.bz2
tar xvzf xvidcore-1.2.2.tar.gz
tar xvzf faad2-2.7.tar.gz
tar xvzf faac-1.28.tar.gz


We need a codec directory

mkdir /usr/local/lib/codecs/


Install Ruby on Rails, subversion & ncurses

yum install subversion ruby libcurses-ruby


Run some SVN queries

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd /usr/local/src/mplayer
svn update


Copy Codecs for mplayer
mkdir /usr/local/lib/codecs
mv /usr/local/src/essential-20071007/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/


We also need to secure the tmp directory
mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp


Install lame

cd /usr/local/src/lame-3.97
./configure
make && make install


Install libogg

cd /usr/local/src/libogg-1.1.3
./configure && make && make install


Install libvorbis


cd /usr/local/src/libvorbis-1.2.0
./configure && make && make install


Install flvtool2
cd /usr/local/src/flvtool2-1.0.6/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install


Install mplayer & mencoder


cd /usr/local/src/mplayer
./configure --enable-jpeg
make && make install


Install AMR (for 3gp conversion)


cd /usr/local/src/amrnb-7.0.0.2
./configure
make && make install

cd /usr/local/src/amrwb-7.0.0.3
./configure
make && make install


Install libtheora (for ogg video encoding)

cd /usr/local/src/libtheora-1.0beta3
./configure
make && make install


Install ffmpeg

For Centos, Redhat, Fedora Users please use this.
./configure --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvorbis --enable-libvpx


Debian Etch and Ubuntu 8.04 users please use the following configure command:
cd /usr/local/src/ffmpeg/
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared --enable-libamr-nb --enable-libamr-wb --enable-nonfree --enable-libtheora


Ubuntu 7.06 users please use the following configure command:
./configure --enable-libmp3lame --enable-libogg --enable-libvorbis --disable-mmx --enable-shared --enable-libamr-nb --enable-libtheora


Now run these commands:

make
make install
ln -s /usr/local/lib/libavdevice.so.52 /usr/lib/libavdevice.so.52
ln -s /usr/local/lib/libavformat.so.52 /usr/lib/libavformat.so.52
ln -s /usr/local/lib/libavcodec.so.52 /usr/lib/libavcodec.so.52
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
ln -s /usr/local/lib/libamrnb.so.3 /usr/lib/libamrnb.so.3
ln -s /usr/local/lib/libamrwb.so.3 /usr/lib/libamrwb.so.3


Install ffmpeg-php

cd /usr/local/src/ffmpeg-php-0.5.0/
phpize
./configure
make
make install


You now need to add the new ffmpeg-php module to the php.ini file

vi /etc/php5/apache2/php.ini
extension=ffmpeg.so (add this line to the end of the file)


Restart the Apache

/etc/init.d/apache2 force-reload

OR
/etc/init.d/httpd restart


FFMPEG-MPlayer-Mencoder-Flvtool2-Lame-MP4Box Installation through script:

cd /usr/local/src
wget http://mirror.ffmpeginstaller.com/old/s ... 6.2.tar.gz
tar -xvzf ffmpeginstaller.6.2.tar.gz
cd ffmpeginstaller.6.2
chmod 755 install.sh


Then start the automated installation.
./install.sh


This script will install the following packages in your server.
* ffmpeg
* Mplayer
* A52decoder
* Amrnb and Amrwb
* All codecs
* facc and faad2
* Ruby
* flvtool2
* ffmpeg-php
* Mplayer and Mencoder
* Lame
* Libogg
* Libvorbis
* Libtheora
* Libwmf
* opencoreamr
* vorbistools
* X264
* MP4Box
* Xvidcore


Restart httpd(apache) service.
/etc/init.d/httpd restart


Done. Cheers :)
chandranjoy
Site Admin
 
Posts: 283
Joined: Fri Oct 23, 2009 11:19 pm

Return to Installation Stuffs

Who is online

Users browsing this forum: No registered users and 2 guests


cron