{"id":556,"date":"2009-07-31T05:12:05","date_gmt":"2009-07-30T22:12:05","guid":{"rendered":"http:\/\/adityo.blog.binusian.org\/?p=556"},"modified":"2010-11-04T06:00:12","modified_gmt":"2010-11-03T23:00:12","slug":"how-to-install-ffmpeg-and-ffmpeg-php-on-opensuse-110","status":"publish","type":"post","link":"https:\/\/adityo.blog.binusian.org\/?p=556","title":{"rendered":"How to install ffmpeg and ffmpeg-php on openSUSE 11.0"},"content":{"rendered":"<h3>What is FFmpeg ?<\/h3>\n<p>FFmpeg is a collection of free software that can record, convert and stream digital audio and video. It includes libavcodec, a leading audio\/video codec library. FFmpeg is developed under Linux, but it can be compiled under most operating systems, including Windows.<\/p>\n<h3>What is FFmpeg-php ?<\/h3>\n<p>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&#8217;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&#8230;). ffmpeg-php can access many of the video formats supported by ffmpeg (mov, avi, mpg, wmv&#8230;)<\/p>\n<h4>Install dependency<\/h4>\n<ol>\n<li>First we need to install apache, php , gcc and make<\/li>\n<\/ol>\n<p># yast2 &#8211;install apache2 apache2-devel apache2-mod_php5 apache2-mod_perl-devel apache2-mod_python php5 php5-devel php5-mbstring php5-mcrypt php5-mysql php5-zlib gcc make<\/p>\n<h4>Installing FFmpeg<\/h4>\n<ol>\n<li>It is fortunate that opensuse have repositories that support FFmpeg installation, how to activate it ? just go to yast2 -&gt; Software -&gt; Software Repositories -&gt;pick\u00a0 Packman Repository -&gt;\u00a0 [Finish] , if youc annot find the repo you can add http:\/\/ftp.skynet.be\/pub\/packman\/suse\/11.0\/\u00a0\u00a0\u00a0 to your software repositories<\/li>\n<\/ol>\n<p><a href=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-557\" title=\"ffmpeg1\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg1.png\" alt=\"ffmpeg1\" width=\"645\" height=\"372\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg1.png 645w, https:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg1-300x173.png 300w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/a><\/p>\n<p>2.\u00a0 Now we just need to install FFmpeg from yast2 and\u00a0 install libffmpeg-devel so we can install\u00a0 FFmpeg-php<\/p>\n<p># yast2 &#8211;install ffmpeg libffmpeg-devel<\/p>\n<p>or go to your yast2 -&gt; Software Management -&gt; tab until you get to Filter and press down arrow until you get Search -&gt; press tab and type ffmpeg -&gt; press tab until the cusrosr to search and enter -&gt; press tab until the cusrosr goes to ffmpeg and press space and find libffmpeg-devel\u00a0 -&gt; tab until your cursor goes to [Accept]<\/p>\n<p><a href=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-558\" title=\"ffmpeg2\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg2.png\" alt=\"ffmpeg2\" width=\"644\" height=\"373\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg2.png 644w, https:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg2-300x173.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/a><\/p>\n<p>our FFmpeg should be installed to checked it use this<\/p>\n<p># rpm -qa | grep ffmpeg<br \/>\nffmpeg-0.5-0.pm.3<br \/>\nlibffmpeg0-0.5-0.pm.3<br \/>\nlibffmpeg-devel-0.5-0.pm.3<\/p>\n<h4>Installing FFmpeg-php<\/h4>\n<p>1.Unfortunately there isn&#8217;t any FFmpeg-php packet on opensuse you need to download the package source<\/p>\n<p># wget http:\/\/sourceforge.net\/projects\/ffmpeg-php\/files\/ffmpeg-php\/0.6.0\/ffmpeg-php-0.6.0.tbz2\/download<\/p>\n<p>then extract it<\/p>\n<p># tar -xjf ffmpeg-php-0.6.0.tbz2<\/p>\n<p>go to ffmpeg-php-0.6.0 directory<\/p>\n<p># cd ffmpeg-php-0.6.0<\/p>\n<p># phpize<\/p>\n<p>Configure and build the extension.<\/p>\n<p># .\/configure &amp;&amp; make<\/p>\n<p>Install the shared extension.<\/p>\n<p># make install<\/p>\n<p>ffmpeg-php common error :<\/p>\n<p>\/root\/ffmpeg-php-0.6.0\/ffmpeg_frame.c: In function \u00e2zim_ffmpeg_frame_toGDImage\u00e2:<br \/>\n\/root\/ffmpeg-php-0.6.0\/ffmpeg_frame.c:336: error: \u00e2PIX_FMT_RGBA32\u00e2 undeclared (first use in this function)<br \/>\n\/root\/ffmpeg-php-0.6.0\/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported only once<br \/>\n\/root\/ffmpeg-php-0.6.0\/ffmpeg_frame.c:336: error: for each function it appears in.)<br \/>\n\/root\/ffmpeg-php-0.6.0\/ffmpeg_frame.c: In function \u00e2zim_ffmpeg_frame_ffmpeg_frame\u00e2:<br \/>\n\/root\/ffmpeg-php-0.6.0\/ffmpeg_frame.c:421: error: \u00e2PIX_FMT_RGBA32\u00e2 undeclared (first use in this function)<br \/>\nmake: *** [ffmpeg_frame.lo] Error 1<\/p>\n<p><span style=\"color: #ff0000;\"><strong>Solution:-<\/strong><\/span><\/p>\n<p>Under the ffmpeg-php-0.6.0 directory modify the file: ffmpeg_frame.c  with nano or vi editor and replace every instance of PIX_FMT_RGBA32 with  PIX_FMT_RGB32<\/p>\n<p><span style=\"color: #339966;\"># nano ffmpeg_frame.c<br \/>\n# Search for PIX_FMT_RGBA32 and replace it with PIX_FMT_RGB32<br \/>\n# Exit from the editor<\/span><\/p>\n<p>Then run the following commands:<\/p>\n<p><span style=\"color: #339966;\"># cd \/root\/src\/ffmpeg-php-0.6.0<br \/>\n# cp -aP ffmpeg_frame.loT ffmpeg_frame.lo<br \/>\n# make clean<br \/>\n# .\/configure<br \/>\n#\u00a0\u00a0 make<br \/>\n#\u00a0\u00a0 make install<\/span><\/p>\n<p>2. Now we need to add ffmpeg modules to php<\/p>\n<p># vi \/etc\/php5\/apache2\/php.ini<\/p>\n<p>add this<\/p>\n<p>; add ffmpeg.so<\/p>\n<p>extension=ffmpeg.so<\/p>\n<p>Reload the apache<\/p>\n<p># \/etc\/init.d\/apache2 reload<\/p>\n<p>3. Now checked your phpinfo and see if the FFmpeg installed or not<\/p>\n<p># php -r &#8216;phpinfo();&#8217; | grep ffmpeg<br \/>\nOLDPWD =&gt; \/root\/ffmpeg-php-0.6.0<br \/>\n_SERVER[&#8220;OLDPWD&#8221;] =&gt; \/root\/ffmpeg-php-0.6.0<\/p>\n<p>Checked on your phpinfo page &lt;? phpinfo(); ?&gt;<\/p>\n<p><a href=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-559\" title=\"ffmpeg3\" src=\"http:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg3.png\" alt=\"ffmpeg3\" width=\"603\" height=\"259\" srcset=\"https:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg3.png 603w, https:\/\/adityo.blog.binusian.org\/files\/2009\/07\/ffmpeg3-300x128.png 300w\" sizes=\"auto, (max-width: 603px) 100vw, 603px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is FFmpeg ? FFmpeg is a collection of free software that can record, convert and stream digital audio and video. It includes libavcodec, a leading audio\/video codec library. FFmpeg is developed under Linux, but it can be compiled under most operating systems, including Windows. What is FFmpeg-php ? ffmpeg-php is an extension for PHP [&hellip;]<\/p>\n","protected":false},"author":386,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2640],"tags":[2641],"class_list":["post-556","post","type-post","status-publish","format-standard","hentry","category-opensuse","tag-install-ffmpeg-and-ffmpeg-php-on-opensuse-110"],"_links":{"self":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/users\/386"}],"replies":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=556"}],"version-history":[{"count":4,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/556\/revisions"}],"predecessor-version":[{"id":801,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/556\/revisions\/801"}],"wp:attachment":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}