Video

ffmpeg, ffmpeg-php, flv

Installing ffmpeg and ffmpeg-php on CentOS 5.2

So, you want your website to upload videos, extract a thumbnail preview image, and then convert the video to FLV for later playback? And sure, there are some commercial packages available, and Adobe will soon be releasing their Flash Media Encoding Server. You want to do it with the open source ffmpeg and ffmpeg-php extension.

Bring the Pain
Go ahead and follow any of the number of installation guides you can find with a simple google. I'll help you, search for installing ffmpeg and ffmpeg-php.

That may work for you, it may not. After you're done frustrating yourself, or if you wish to avoid that, read on.

As of this writing the current version of ffmpeg is NOT compatible with the current version of ffmpeg-php.

There are a variety of guides promising successful installations, however the bottom line is that with these being open source projects you need to be aware that just because it worked 6 months ago, heck 1 week ago, doesn't mean it'll work today on your server.

I spent 2 days, partially due to refamiliarizing myself with linux, installing and uninstalling various combinations of each package trying to get them to be happy with one another. The issues causing the key problem appears to be pretty clearly a change ffmpeg made recently, which you can read about in the ffmpeg-php google group.

Basically, everything installs until you get to installing ffmpeg-php and during the make you get errors. Sadly, it takes quite a while to get to that point.

Take the Easy Way
Sherinman A, an open source developer, has put together a set of scripts called FfmpegInstall that does the installation for you.

I was hesitant to run scripts to install all the various components to this solution. I wanted to know what was being installed and I wanted to stay with RPM and yum, or at least source from the SVN repositories where possible. The ffmpeg and ffmpeg-php packages are distributed off his server which may cause some people concern, but it works. And after banging your head against the keyboard for a couple of days that is mighty fine news.

If it makes you feel any better, he has received a FOSS India Award award for his work on this project.

FfmpegInstall comes in 2 flavors, one for shared hosting and another for when you have your own server. There are also forums for you should you need some additional community support.

It's such a sweet feeling to finally get this stuff installed and working, load up your first video and see the beautiful thumbnail and converted FLV produced as desired.

 


Categories: VideoPermalink
blog comments powered by Disqus