15대 16대 대통령 추모 배너

'ubuntu'에 해당되는 글 2건

  1. 2009/07/10 ffmpeg-php error PIX_FMT_RGBA32
  2. 2009/03/10 리눅스(Ubuntu)에 FFmpeg와 MPlayer 설치하기 (1)
Developer/Video Encoding2009/07/10 10:45

ffmpeg-php-0.6.0 컴파일 중에 발생되는 에러입니다. (Ubuntu)

0.6.0 하위버전 에서도 같은 문제가 나타날 수 있으며 해결방법은 똑같습니다.

 

/usr/local/src/ffmpeg-php-0.5.3/ffmpeg_frame.c: In function ‘zif_toGDImage’:
/usr/local/src/ffmpeg-php-0.5.3/ffmpeg_frame.c:448: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)
/usr/local/src/ffmpeg-php-0.5.3/ffmpeg_frame.c: In function ‘zif_ffmpeg_frame’:
/usr/local/src/ffmpeg-php-0.5.3/ffmpeg_frame.c:533: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)
make: *** [ffmpeg_frame.lo] Error 1

 

ffmpeg-php 컴파일 시 PIX_FMT_RGBA32 에러 발생으로 컴파일이 안되면,

 

아래 명령을 실행합니다.

perl -i -p -e ’s/PIX_FMT_RGBA32/PIX_FMT_RGBA/g;’ ffmpeg_frame.c

 

다시 컴파일을 시도하면 문제가 해결됩니다…^^

 

 

출처 : http://blog.hostonnet.com/ffmpeg-php-error-pix_fmt_rgba32

Posted by 슈팅스타337
Developer/Video Encoding2009/03/10 13:55

This howto is written for Ubuntu 8.10 and is verified to work on 8.2.2009.

 

I found numerous tutorials on this subject out there but they all failed me, but combination of them all was successful. So fallowing is made from 10 different tutorials.

And for all those who will ask why not just apt-get php5-ffmpeg, answer is so we can configure ffmpeg with libs and options we need.

 

 

준비

apt-get update
apt-get upgrade
apt-get install libjpeg-progs libjpeg62 libjpeg62-dev libsdl1.2-dev php5-dev php5-cli php5-gd build-essential unzip

 

파일 다운로드

cd /usr/local/src

wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2  

wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz  

wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz  

wget http://superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2  

wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz  

wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz  

wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2  

wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2  

wget http://downloads.xiph.org/releases/theora/libtheora-1.0beta3.tar.gz

 

압축해제

tar zxvf lame-3.97.tar.gz  

tar zxvf libogg-1.1.3.tar.gz  

tar zxvf libvorbis-1.2.0.tar.gz  

tar zxvf flvtool2-1.0.6.tgz  

tar jxvf essential-20071007.tar.bz2  

tar jxvf ffmpeg-php-0.6.0.tbz2  

bzip2 -cd amrnb-7.0.0.2.tar.bz2 | tar xvf -  

bzip2 -cd amrwb-7.0.0.3.tar.bz2 | tar xvf -  

tar zxvf libtheora-1.0beta3.tar.gz 

 

Ruby on Rails, Subversion & ncurses 설치

apt-get install subversion ruby libcurses-ruby

 

Mplayer, FFmpeg 다운로드

저장소에서 체크아웃 받은 후 최신버전으로 업데이트합니다.

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

 

코덱 복사

mkdir /usr/local/lib/codecs  

mv /usr/local/src/essential-20071007/* /usr/local/lib/codecs/  

chmod -R 755 /usr/local/lib/codecs/ 

 

임시 디렉토리(TMP) 생성

mkdir /usr/local/src/tmp  

chmod 777 /usr/local/src/tmp  

export TMPDIR=/usr/local/src/tmp

 

라이브러리 설치

각 디렉토리에서 컴파일 후 설치합니다.

./configure && make && make install

  1. lamemp3 설치
  2. libogg 설치
  3. libvorbis 설치
  4. AMR 설치
  5. libtheora 설치

 

flvtool2 설치

cd /usr/local/src/flvtool2-1.0.6/  

ruby setup.rb config  

ruby setup.rb setup  

ruby setup.rb install 

 

Mplayer & Mencoder 설치

{주의} H.264 인코딩 시 x264 라이브러리를 설치한 후 추가해야 합니다. : Mencoder Shell Script와 라이브러리 추가

cd /usr/local/src/mplayer

./configure --enable-jpeg

make && make install

 

FFmpeg 설치

cd /usr/local/src/ffmpeg/  

./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared --enable-libamr-nb --enable-libamr-wb --enable-nonfree --enable-libtheora  

make  

make install

 

{주의} 설치도중 라이브러리를 찾을 수 없는 에러가 발생할 수 있습니다. 이 경우 심볼릭 링크를 통해 라이브러리 경로를 지정해 줍니다.

ln -s /usr/local/lib/[YOUR LIB NAME] /usr/lib/[YOUR LIB NAME]

 

FFmpeg-php 설치

cd /usr/local/src/ffmpeg-php-0.6.0/  

phpize  

./configure --with-ffmpeg=/usr/local/ffmpeg  

make  

make install 

 

php.ini 에 모듈을 추가한 후 웹 서버를 다시 시작합니다.

echo 'extension=ffmpeg.so' >> /etc/php5/apache2/php.ini  

/etc/init.d/apache2 restart

 

 

 

 

원문 : http://www.hazaah.com/ubuntu/how-to-ffmpeg-ffmpeg-php-lame-libogg-libvorbis-flvtool2-mplayer-mencoder-amr/

Posted by 슈팅스타337