Posted by : Tom Doyle in (Web Development) 16th Nov, 2007

FFMPEG - Convert 3GP files to FLV

Well as the saga continues on our latest project, today we finally got FFMPEG functioning correctly. We can now convert 3GP files to FLV files on the fly using FFMPEG and PHP.

No matter what we did, it just wouldn’t convert the sound, it would only convert the video. Although it seemed that the command is simple, e.g.
 
exec("ffmpeg -i yourvideo.avi -ar 22050 -ab 32 -f flv -s 320x240 yourvideo.flv")

But that didn’t work.

So for the last couple of weeks we focused our attention on ensuring FFMPEG was installed PROPERLY on our server.

After a lot of great work by Paul and Niall from Blacknight (thanks guys!) we finally got it working.

For those of you just embarking on this new challenge, I suggest you focus your attention on installing FFMPEG correctly first. The guts of what you need to do is to install and enable the libamr codecs.

I spent days trawling forums and mail lists looking for the solution and a lot of them pointed me towards the command I was using to execute FFMPEG. This was not what I needed. 

In one way they helped, because it helped me understand how FFMPEG worked, on the other, it made me expect FFMPEG to work without having to look further into the configuration of FFMPEG.

So to help you out, this is how our FFMPEG installation configuration now looks:

./configure –enable-gpl –enable-pp –enable-libmp3lame –enable-libfaac –enable-libamr –enable-libamr-nb –enable-libamr_wb –enable-shared

 

On my searches to find the solution,  I found ome great sources of information on FFMPEG, here are some links:

http://www.luar.com.hk/blog/?cat=32
http://www.db75.com/blog/archives/000177.html
http://julian.coccia.com/blog/index.php?p=66&more=1


Comments:

Make a comment