<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fedora &#187; FFMPEG</title>
	<atom:link href="http://gofedora.com/archives/category/ffmpeg/feed/" rel="self" type="application/rss+xml" />
	<link>http://gofedora.com</link>
	<description>How Tos, Tutorials, Tips and Tricks</description>
	<lastBuildDate>Thu, 25 Feb 2010 07:55:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To: Install FFMPEG and FFMPEG-PHP</title>
		<link>http://gofedora.com/how-to-install-ffmpeg-ffmpeg-php/</link>
		<comments>http://gofedora.com/how-to-install-ffmpeg-ffmpeg-php/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 18:50:27 +0000</pubDate>
		<dc:creator>Kulbir Saini</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[FFMPEG]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[Video Conversion]]></category>

		<guid isPermaLink="false">http://172.17.8.64/gofedora/?p=182</guid>
		<description><![CDATA[I was randomly browsing the internet and reading about making a website look better and I encountered ffmpeg-php. ffmpeg is a very powerful tool to record, convert and stream audio and video. Its a very rich tool almost supporting every format out there in the world. It can convert any format to any other format [...]<p><a href="http://gofedora.com/">Fedora Tutorials</a> and <a href="http://cachevideos.com/">Videocache</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p></p><p>I was randomly browsing the internet and reading about making a website look better and I encountered ffmpeg-php. <a rel="nofollow" href="http://gofedora.com/goto/http://ffmpeg.mplayerhq.hu/"  target="_blank">ffmpeg</a> is a very powerful tool to record, convert and stream audio and video. Its a very rich tool almost supporting every format out there in the world. It can convert any format to any other format provided the codec. <a rel="nofollow" href="http://gofedora.com/goto/http://ffmpeg-php.sourceforge.net/"  target="_blank">ffmpeg-php</a> is an extension for <a rel="nofollow" href="http://gofedora.com/goto/http://php.net/"  target="_blank">PHP</a> that provides a rich library to access info about audio and video files. The good thing about ffmpeg-php is that it can retrieve all info about any audio/video file subjected to the condition that the particular audio/video format is supported by your ffmpeg installation. So, now you have a clear idea that you can do wonders with audio/videos while showing them on your site <img src='http://gofedora.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' title="How To: Install FFMPEG and FFMPEG PHP" /> </p>
<p>I tried some of the functionalities and they worked out of the box. Here&#8217;s is complete how to on installing ffmpeg and ffmpeg-php.</p>
<h3><strong><span style="text-decoration: underline;">FFMPEG:</span></strong></h3>
<p>I tried installing ffmpeg from rpms provided by several Fedora repositories but after installation ffmpeg doesn&#8217;t seem to work. After several tries, I installed ffmpeg from source rpms  and it worked. Below, I will describe how to install ffmpeg from source rpm.</p>
<h4><strong><span style="text-decoration: underline;">Step 1:</span></strong></h4>
<p>Make sure that you have &#8216;rpmbuild&#8217; installed by issuing</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rpm -q rpmbuild [Enter]</span></pre></div></div>

<p>command. If the above says that rpmbuild is not installed, then install it using yum as given below</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># yum install rpmbuild [Enter] (do as root)</span></pre></div></div>

<h4><strong><span style="text-decoration: underline;">Step 2:</span></strong></h4>
<p>Download the latest src rpm of ffmpeg from <a rel="nofollow" href="http://gofedora.com/goto/http://rpmfind.net/linux/rpm2html/search.php?query=ffmpeg&amp;submit=Search+...&amp;system=&amp;arch=src"  target="_blank">rpmfind.net</a>. Issue the command given below</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rpm -hiv ffmpeg-x.x.x.xx-xxx.src.rpm [Enter] (do as root)</span></pre></div></div>

<h4><strong><span style="text-decoration: underline;">Step 3:</span></strong></h4>
<p>Go to &#8216;/usr/src/redhat/SPECS/&#8217; directory and issue the command given below</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd /usr/src/redhat/SPECS/ [Enter]</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux SPECS<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rpmbuild -ba ffmpeg.spec [Enter] (do as root)</span></pre></td></tr></table></div>

<p>If it gives an error like package &#8216;xyz&#8217; is need by ffmpeg. Then install the package &#8216;xyz&#8217; using yum as</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux SPECS<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># yum install xyz [Enter] (do as root)</span></pre></div></div>

<p>After installing the dependencies, issue the rpmbuild command &#8216;rpmbuild -ba ffmpeg.spec&#8217;. Now ffmpeg rpms will be build and they will be stored in &#8216;/usr/src/redhat/RPMS/i386/&#8217;.</p>
<h4><strong><span style="text-decoration: underline;">Step 4:</span></strong></h4>
<p>Go the &#8216;/usr/src/redhat/RPMS/i386/&#8217; (x86_64 instead of i386 if your OS is 64 bit). Install all the rpms that were built by rpmbuild.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rpm -hiv *.rpm [Enter] (do as root)</span></pre></div></div>

<p>Thats it. ffmpeg is now successfully installed on your computer. Half the job is done. Now lets proceed with ffmpeg-php installation.</p>
<h3><strong><span style="text-decoration: underline;">FFMPEG-PHP:</span></strong></h3>
<p>We will install ffmpeg-php from source bundle.</p>
<h4><strong><span style="text-decoration: underline;">Step 1:</span></strong></h4>
<p>Make sure that &#8216;php-devel&#8217; installed on your machine by issuing</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rpm -q php-devel [Enter]</span></pre></div></div>

<p>command. If the above command says the &#8216;php-devel&#8217; is not installed, then install it using the following command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># yum install php-devel [Enter] (do as root)</span></pre></div></div>

<h4><strong><span style="text-decoration: underline;">Step 2:</span></strong></h4>
<p>Download the latest version of ffmpeg-php from <a rel="nofollow" href="http://gofedora.com/goto/http://sourceforge.net/project/showfiles.php?group_id=122353&amp;package_id=133626"  target="_blank">here</a>. Unpack the file you have downloaded.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># bunzip2 -d ffmpeg-php-0.5.1.tbz2 [Enter]</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># tar -xvf ffmpeg-php-0.5.1.tar [Enter]</span></pre></td></tr></table></div>

<h4><strong><span style="text-decoration: underline;">Step 3:</span></strong></h4>
<p>Issue the following command in sequence if everything goes fine.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd ffmpeg-php-0.5.1 [Enter]</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux ffmpeg-php-0.5.1<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># phpize [Enter]</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux ffmpeg-php-0.5.1<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ./configure [Enter]</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux ffmpeg-php-0.5.1<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># make [Enter]</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux ffmpeg-php-0.5.1<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># make install [Enter] (do as root)</span></pre></td></tr></table></div>

<h4><strong><span style="text-decoration: underline;">Step 4:</span></strong></h4>
<p>Open &#8216;/etc/php.ini&#8217; and add a line &#8216;extension=ffmpeg.so&#8217; in the category &#8216;Dynamic Extensions&#8217;. For help see the image below.<br />
<a href="http://gofedora.com/wp-content/uploads/2007/12/ffmpeg-php-phpini-module.jpg" ><img class="alignnone size-full wp-image-184" title="FFMPEG PHP PHPini Module" src="http://gofedora.com/wp-content/uploads/2007/12/ffmpeg-php-phpini-module.jpg" alt="FFMPEG PHP PHPini Module" width="308" height="344" /></a></p>
<h4><strong><span style="text-decoration: underline;">Step 5:</span></strong></h4>
<p>Restart apache web server aka &#8216;httpd&#8217; service by issuing the command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># service httpd restart [Enter] (do as root)</span></pre></div></div>

<h4><strong><span style="text-decoration: underline;">Step 6:</span></strong></h4>
<p>Write a test php file and test your ffmpeg-php installation.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">phpinfo<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;</pre></div></div>

<p>Save the above code in &#8216;info.php&#8217; and save the file in &#8216;/var/www/html/&#8217; and browse <a rel="nofollow" href="http://gofedora.com/goto/http://localhost/info.php"  target="_blank">http://localhost/info.php</a> . If you see something like this.<br />
<a href="http://gofedora.com/wp-content/uploads/2007/12/ffmpeg-php-linux.jpg" ><img class="alignnone size-full wp-image-185" title="FFMPEG PHP Linux" src="http://gofedora.com/wp-content/uploads/2007/12/ffmpeg-php-linux.jpg" alt="FFMPEG PHP Linux" width="603" height="226" /></a><br />
Then the ffmpeg-php is successfully installed on your machine. Now you can jump into the world of video manipulation via your website.<br />
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://gofedora.com/how-to-install-phpming/"  title="How To: Install PHP-Ming">How To: Install PHP-Ming</a></li>
<li><a href="http://gofedora.com/how-to-install-wordpress-lamp/"  title="How To: Install Wordpress on LAMP">How To: Install Wordpress on LAMP</a></li>
<li><a href="http://gofedora.com/bug-strange-libstdcso5-problem-fedora-7/"  title="Bug: Strange libstdc++.so.5 Problem in Fedora 7">Bug: Strange libstdc++.so.5 Problem in Fedora 7</a></li>
</ul>
<p><a href="http://gofedora.com/" >Fedora Tutorials</a> and <a href="http://cachevideos.com/" >Videocache</a> by <a href="http://saini.co.in/" >Kulbir Saini</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gofedora.com/how-to-install-ffmpeg-ffmpeg-php/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
