December 27, 2004

FFMPEG Conversion to Flash Video Format

If you've experimented with Flash video then you've most likey run into the scenario where you'd like to be able convert to flv on the fly. While Flash has support for certain video formats such as .mpg, .avi, and .mov this is usually handled by importing your video into the IDE and then exporting to .flv format.

Using a tool such as ffmpeg you can do the encoding on the fly. From the command line you can do something like:

ffmpeg -i video.mpg -r 12 -b 10 video.flv

The -i parameter tells the program to accept video.mpg as the input file.

The -r parameter sets the frame rate for the encoded flv video, in this case 12 frames per second.

The -b parameter sets the bitrate for the encoded flv video, in this case 10kbps.

The best thing of all is that this utility is completely free! I'm working on a ColdFusion app that allows you to upload small video clips and encodes/plays them on the fly through the Flash player. I'll post a link when it's ready.

Posted by dennis baldwin at December 27, 2004 01:45 PM
Comments

Very nice. Can't wait to tinker with your app. ;-)

Posted by: Brenton at December 30, 2004 02:18 PM

I can't get it to work... I keep getting these errors:
[huffyuv @ 0x225248]Error: YV12 is not supported by huffyuv; use vcodec=ffvhuff or format=422p

and those suggestions? well, I get a notice trying to use ffvhuff that it is still under development and shouldn't be used, and 422p isn't recognised.. ??

Posted by: Joeri at January 16, 2005 05:42 PM