
Flash Video Conversion with FFMPEG
Lately, we've had quite a few clients want to have video on their websites. The growing trend (since sites like YouTube first debuted) is to have the video contained in a flash player for greater compatibility across various platforms and browsers. But what is the best way to accomplish this? Can the conversion be automated? I came across a very slick tool called FFMPEG that makes things very easy for developers like me.
A Little Background In order to display video in a Flash movie easily, it must be converted from its original format (AVI, MPEG, MOV, etc...) into an FLV format. There are several tools to do this, but the most compatible one I've found for the desktop is Flash's built in video converter. You can find some more information here. Once it's in an FLV format, it can be placed inside a flash player that has contols for playing stopping, etc... In fact, this functionality is built into Adobe (Macromedia) Flash to make things really simple.
The Problem This is all well and good, and works for simple situations, but what if the website has a ton of video content? Websites with a high volume of video content like YouTube have to have capabilities to automatically encode video to the FLV format without human interaction. Without automated conversion, it would be a very time-consuming process. This is where FFMPEG comes into play. It can be installed directly on the web server and be set up to intercept video as it's uploaded to make the conversion! Not only can it convert the video, but it can additionally be complied in with PHP to do things like capture thumbnail images from video, determine size, and other similar functions. We have a project in development right now that takes advantage of FFMPEG and its automated conversion tools. JCOC.tv will be an internet television channel and interactive social networking community for fans, connoisseurs and those who want to learn about gems, jewelry and watches. It's set to be launched August 1st. I'll make another post about it once it's up and running to discuss any issues that we come across during the development.
