CentOS servera FFMPEG kurulumu

Bu dokuman sniperscope tarafindan Tahribat.com icin hazirlanmistir.
Alinti yaparken kaynak belirtiniz.

Unix sistemlerde birseyler kurmak cidden basagrisidir. Elimden geldigince kendi deneyimlerden yararlanarak sizlere Allah'in belasi FFMPEG kurmayi anlatacagim.

Bu dokumani daha ileriki zamanlarda okuyacaklar icin mumkun mertebe codeclerin linklerinide yaziya ekleyecegim.

Oncelikle sistemimizde varsa codecleri temizleyelim.
# yum remove libvpx libogg libvorbis libtheora libx264 x264 ffmpeg

Simdi bize gerekli olan ivir ziviri kuralim
# yum install gcc
# yum install make
# yum install nasm
# yum install zlib-devel
Eger yukaridaki komutlardan sonra konsolda "Nothing to do" mesaji cikarsa demekki o paket zaten sistemimizde kuruludur. Es gecip digerini kuruyoruz.

Ana dizine donelim
# cd
ffmpeg programini ve komponentleri derli toplu olmasi icin belli bir klasore koyalim
# mkdir ffmpeg
# cd ffmpeg

FFMPEG icin gerekli olan assembler kuralim. yasm programi(veya herneyse) yum ilede kurulabilir.
Soyleki
# yum install yasm
eger yukaridaki komut ile yasm kurabildiyseniz asagidakileri uygulamayin. Ben yum ile kuramadiginizi varsayiyorum.
Oyleyse devam...

1 - YASM Kurulumu
# mkdir yasm
# cd yasm
# wget http://www.tortall.net/projects/yasm/release/yasm-1.2.0.tar.gz
# tar -xzvf yasm-1.2.0.tar.gz
# cd yasm-1.2.0
# ./configure
# make && make install

Eger isler yolunda gittiyse matrix benzeri bir dunya yazi ekrandan gecioyor olmasi lazim. Gectigini varsayim diger adima geciyorum.
# cd ..
# cd ..
boylece ffmpeg ana klasorune geri donduk.

2 - GIT kurulumu
Simdi ise Git i kuralim. Eger asagidaki komutlari calistirirken hata alirsaniz o zaman
# service iptables save
# service iptables stop
komutlarini calistirip iptables i devre disi birakiyoruz.

Burada halen ffmpeg klasoru icinde oldugunuzu varsayarak devam...
# mkdir git
# cd git
# wget http://git-core.googlecode.com/files/git-1.7.9.tar.gz
# tar xvzf git-1.7.9.tar.gz
# cd git-1.7.9
# ./configure
# make && make install

Git i sorunsuz kurdugumuzu test edelim.
# cd
# mkdir git-test
# cd git-test
# git init
Eger Git i dogru sekilde kurmus ise asagidaki sekilde bir mesaj almamiz gerekiyor.

Initialized empty Git repository in /root/git-test/.git/
bu uyari aldiysaniz o zaman Git i de sorunsuz kurdunuz demektir.

Simdi ffmpeg klasorumuze geri donelim. Ama once gereksiz test klasorumuzu silelim.
# cd
# rm -rf git-test
# cd ffmpeg


Gerekli codecleri kuralim.

1 - XVID Codec kurulumu
# mkdir xvid
# cd xvid
# wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
# tar -zxf xvidcore-1.3.2.tar.gz
# cd xvidcore/build/generic
# ./configure
# make && make install
# cd ..
# cd ..
XVID sitesi : http://www.xvid.org/

2 - LAME Codec kurulumu
# mkdir lame
# cd lame
# wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz
# tar -zxf lame-3.98.4.tar.gz
# cd lame-3.98.4
# ./configure
# make && make install
# cd ..
# cd ..
LAME sitesi : http://lame.sourceforge.net/

3 - FAAC Codec kurulumu
# mkdir faac
# cd faac
# wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gz
# tar -xzf faac-1.28.tar.gz
# cd faac-1.28
# ./bootstrap
# ./configure
# make && make install
# cd ..
# cd ..
FAAC sitesi : http://www.audiocoding.com/

4 - OpenCore AMR Codec kurulumu (Ne ise yaradigi hakkinda en ufak bir bilgim yok ama siz yinede kurun, lazim olur ileride)
# mkdir opencore
# cd opencore
# wget http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/0.1.2/opencore-amr-0.1.2.tar.gz
# tar -xzf opencore-amr-0.1.2.tar.gz
# cd opencore-amr-0.1.2
# ./configure
# make && make install
# cd ..
# cd ..
Lazim olursa sitesi : http://sourceforge.net/projects/opencore-amr/

5 - OGG Codec kurulumu
# mkdir ogg
# cd ogg
# wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
# tar -xzf libogg-1.3.0.tar.gz
# cd libogg-1.3.0
# ./configure
# make && make install
# cd ..
# cd ..
OGG sitesi : http://www.xiph.org/downloads/

6 - Vorbis Codec kurulumu
# mkdir vorbis
# cd vorbis
# wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.bz2
# tar -xjf libvorbis-1.3.2.tar.bz2
# cd libvorbis-1.3.2
# ./configure
# make && make install
# cd ..
# cd ..
LIBVORBIS sitesi : http://www.xiph.org/downloads/

7 - x264 Codec kurulumu
# git clone git://git.videolan.org/x264.git
# cd x264
# ./configure --enable-static
# make && make install
# cd ..

8 - LIBVPX -VP8 Video encoder
# git clone http://git.chromium.org/webm/libvpx.git
# cd libvpx
# ./configure
# make && make install

9 - FFMPEG kurulumu
# git clone git://git.videolan.org/ffmpeg.git ffmpeg
# cd ffmpeg
Zurnanin zart dedigi yere geldik.
Hani su 4 numarada bahsettigim kodec varya, iste onu kurmadiysaniz asagidaki komutu oldugu gibi calsitirin aksi halde
--enable-libopencore-amrnb ve --enable-libopencore-amrwb yazilarini silin.

# ./configure --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libxvid --enable-gpl --enable-postproc --enable-nonfree
# make && make install

Eger burada hata aldiysaniz(ki alma ihtimaliniz %99.99) asagidaki yonergeleri izleyin
# cd
# cd /home
# mkdir tmp
# export TMPDIR=$HOME/tmp

daha sonra
# cd
# cd ffmpeg
# cd ffmpeg
# ./configure --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libxvid --enable-gpl --enable-postproc --enable-nonfree
# make && make install

Eger hersey yolunda gitmis ise asagidaki komut ile beraber soyle bir cikti almaniz lazim(Ornektir, birebir ayni olacak diye birsey yok)

# ffmpeg

ffmpeg version N-49610-gc2dd5a1 Copyright (c) 2000-2013 the FFmpeg developers
built on Feb 5 2013 13:26:02 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 17.101 / 52. 17.101
libavcodec 54. 91.100 / 54. 91.100
libavformat 54. 61.104 / 54. 61.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 35.101 / 3. 35.101
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfi
le}...

Use -h to get full help or, even better, run 'man ffmpeg'

Devam edelim...

MPLAYER kurulumu
# yum install mplayer

RUBY kurulumu
# /scripts/installruby

FLVTOOL kurulumu
# gem install flvtool2

Diger komponentlerin kurulumu
# yum install gpac gpac-libs
# yum install ffmpeg-devel


Eger FFMPEG i php uzantisi olarak kurmak istiyorsaniz devam edin yoksa burada birakin. Sisteminize FFMPEg kurdunuz tebrikler !!!

# cd ..
# mkdir ffmpeg-php
# cd ffmpeg-php
# wget http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
# tar xjf ffmpeg-php-0.6.0.tbz2
# cd ffmpeg-php-0.6.0
# sed -i 's/PIX_FMT_RGBA32/PIX_FMT_RGB32/g' ffmpeg_frame.c
# phpize
# ./configure
# make && make install

kurulumdan sonra size asagidaki gibi bir cikti verecektir

extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613" (en sondaki rakam sizde degisebilir, onemli degildir)

Simdi php.ini dosyamizi kontrol edelim
# nano /usr/local/lib/php.ini

php.ini dosyasi icinde yukaridaki ciktiyi arayin bulursaniz zaten islem tamamlanmistir, bulamazsaniz o zaman o ciktiyi kendiniz php.ini dosyasina extension_dir yazan yerin hemen altina yaziniz.
Ornek :
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
hemen altina ise eger yoksa asagidaki satiri ekleyin
extension="ffmpeg.so"

php.ini dosyasini kaydedip cikin sirasiyla
CTRL + X
SHIFT + Y
ENTER
ENTER

simdi apache yi yeniden baslatalim
# /etc/init.d/httpd restart

php.ini dosyamizi kontrol edelim.
# php -i | grep ffmpeg
yazip enter a bastiginizda asagidaki gibi bir mesaj almaniz lazim.

ffmpeg
ffmpeg-php version => 0.6.0-svn
ffmpeg-php built on => Jun 2 2012 20:48:04
ffmpeg-php gd support => enabled
ffmpeg libavcodec version => Lavc52.123.0
ffmpeg libavformat version => Lavf52.111.0
ffmpeg swscaler version => SwS0.14.1
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0
OLDPWD => /root/ffmpeg-php-0.6.0
_SERVER["OLDPWD"] => /root/ffmpeg-php-0.6.0
_ENV["OLDPWD"] => /root/ffmpeg-php-0.6.0


Eger yukaridaki ciktiyi aldiysaniz hem FFMPEG i kurdunuz hemde php extension olarak tanittiniz. Tebrikler !!!

Tarih:
Hit: 1083583
Yazar: sniperscope

Taglar: centos servera ffmpeg kurulumu


Yorumlar


Siftahı yapan siz olun
Yorum yapabilmek için üye girişi yapmalısınız.