Skip to content

[CentOS] ffmpeg 설치

조회 수 24495 추천 수 0 2012.02.07 17:48:02
1. First install subversion and ruby via yum or up2date:

yum -y install subversion ruby

yum install subversion*

yum install ncurses-devel*





2. make ffmpeg

cd /
mkdir ffmpeg





3. Now we need to install MPlayer & FFmpeg sources from SVN:

cd /ffmpeg
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer





4. Now we need some codecs:

wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
tar xvjpf essential-20071007.tar.bz2
cd essential-20071007
mkdir /usr/local/lib/codecs
mv * /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/
cd /ffmpeg





5. Next we will install LAME MP3 encoder:

wget http://downloads.sourceforge.net/lame/lame-398-2.tar.gz
tar xvzpf lame-398-2.tar.gz
cd lame-398-2
./configure --prefix=/usr
make
make install
cd /ffmpeg





6. Now we install Libogg:

wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
tar xvzpf libogg-1.1.3.tar.gz
cd libogg-1.1.3
./configure --prefix=/usr
make
make install
cd /ffmpeg







7. 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:

/usr/lib
/usr/local/lib





8. Now save and run the following command:

ldconfig



※ 7, 8 과정은 생략하여도 문제가 없는듯...






9. To install libvorbis we will run:

wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
tar xvzpf libvorbis-1.2.0.tar.gz
cd libvorbis-1.2.0
./configure --prefix=/usr
make
make install
cd /ffmpeg





10. Now we will install FLVTool2:

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





11. Next we should build MPlayer & MEncoder and it will take a while unless you have a nice dual or quad core machine. Note that I’ve seen the SVN version of these packages break before, so you can always download the source code from their site (a stable copy) if it fails on make:

cd mplayer
./configure --prefix=/usr
make
make install
cd /ffmpeg





12. We will now build FFmpeg:

mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp
cd /ffmpeg/ffmpeg
./configure --prefix=/usr --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
make
make install
cd /ffmpeg

※ 여기서 make하면, error가 발생하는 경우가 있습니다.
In file included from libavdevice/v4l.c:33:
/usr/include/linux/videodev.h:56: error: syntax error before "ulong"
/usr/include/linux/videodev.h:72: error: syntax error before '}' token
libavdevice/v4l.c: In function `grab_read_header':
libavdevice/v4l.c:75: error: storage size of 'tuner' isn't known
libavdevice/v4l.c:133: error: invalid application of `sizeof' to incomplete type `video_tuner'
libavdevice/v4l.c:140: error: invalid application of `sizeof' to incomplete type `video_tuner'
libavdevice/v4l.c:75: warning: unused variable `tuner'
make: *** [libavdevice/v4l.o] 오류 1

이런 error가 뜨신다면!
vi /usr/include/linux/videodev.h 해서 ulong을 unsigned long으로 바꿔주시면 문제 해결!




13. Symlink some libraries if needed (ignore file exists errors):

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





14. Now build FFmpeg-PHP:

wget http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
tar xvjpf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0
phpize
./configure --prefix=/usr
make
make install
cd /ffmpeg

※ 저는 이 과정은 생략하였습니다.
허나 실행은 잘되는군요!ㅋ




15. Now you need to copy the ffmpeg.so file that was created from it’s location (from the build) to /usr/local/lib/php/extensions/, it should look something like:

cp /usr/local/lib/php/extensions/no-debug-non-zts-????????????/ffmpeg.so /usr/local/lib/php/extensions/



16. Modify your php.ini. Try /etc/php.ini or /usr/lib/php.ini or /usr/local/Zend/etc/php.ini as they are common locations, you can do php -i | grep -i ini to find the proper location. Change the extension_dir value as seen below and add the extension as seen below:

extension_dir = “/usr/local/lib/php/extensions/”
extension=ffmpeg.so





17. Now save and restart apache and test php for ffmpeg on both apache via phpinfo() and from shell:


/etc/rc.d/init.d/httpd restart

php -r 'phpinfo();' | grep ffmpeg
profile

일요일은 짜빠게뤼~ 먹는날~^^

엮인글 :
http://adminplay.com/77048/6c7/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수sort
287 CentOS Samba 설정 ADMINPLAY 2010-11-08 24884
286 가볍고 강력한 SNMP를 이용한 모니터링 프로그램입니다. file ADMINPLAY 2009-10-31 24859
285 리눅스 - htop file ADMINPLAY 2010-09-12 24838
284 favicon 만들기 ADMINPLAY 2009-09-30 24835
283 네트워크 관리자를 위한 통합 모니터링 툴 - N.E.W.T file [2] ADMINPLAY 2009-10-31 24705
282 리눅스 - zip 압축 해제 ADMINPLAY 2009-07-25 24646
» [CentOS] ffmpeg 설치 ADMINPLAY 2012-02-07 24495
280 리눅스 Proxy Server[Squid] 설정법[RedHatLinux8.0] ADMINPLAY 2009-11-26 24408
279 커널 컴파일 장애 처리 perl: warning: Please check that... ADMINPLAY 2009-08-08 24378
278 대용량 하드 디스크 파티셔닝 (GPT 파티션) ADMINPLAY 2009-06-04 24364
277 lighttpd와 Apache의 성능 차이 file [2] l2zeo 2012-03-08 24242
276 [Flash] 크로스 도메인 설정 방법 ADMINPLAY 2010-08-31 24233
275 로드밸런싱의 ‘꽃’, L4/L7 스위치 관심 집중 ADMINPLAY 2009-11-30 24151
274 kernel panic 발생 시 자동으로 리부팅 설정 ADMIN 2008-12-10 24084
273 하드웨어정보 확인(lshw) file ADMINPLAY 2008-11-03 24038
272 MRTG 소스 설치 ADMINPLAY 2010-05-11 24028
271 리눅스에서 특정 파일을 제외하고 삭제하기 ADMIN 2008-11-03 23970
270 VI 에디터 유니코드(UTF-8)로 인코딩 전환 ADMINPLAY 2010-04-02 23966
269 리눅스 공유 메모리의 설정 (세마포어) ADMINPLAY 2010-04-28 23950
268 젠투리눅스에서 잃어버린 암호를 다시 설정하기 ADMINPLAY 2010-04-15 23899

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234