Transcoding to Flash using ffmpeg

Transcoding to Flash

Some students from a senior design class created a movie of their project. They created is using Quicktime, I think. What they created was a 153MB .MOV file.

That doesn't work so well on the web or if you aren't on a fast network connection.

After some scrounging with google I settled on using ffmpeg.

Afer some more googling I settled on the following command:

ffmpeg -y -i ProjectKronos.mov -b 800K -r 29.97 -f flv -ar 44100 -ab 96 -acodec libmp3lame -s 570x380 ProjectKronos_test.flv

I usually work in Linux but ffmpeg has ports fo Windows as well (and probably Mac) so the commands to use should most be the same.

Let's break that command down: -y : overwrites the output file if it exists
-i ProjectKronos.mov : the input file to use
-b 800K : video bit rate, sort of sets the quality
-r 29.97 : frame rate
-f : format to convert to, in this case Flash Video or flv
-ar : audio sampling rate
-ab : audio bitrate, sort of sets audio quality
-acodec : audio codec to use, in this case libmp3lame to use MP3
-s : sets the frame size
ProjectKronos_test.flv : the last thing in the command is the output file

So that runs for a bit and might create some error messages you can ignore.

You then put it on the web and it doesn't work. You ask Hilary what went wrong and find out that if you start playing the file, pause it and restart playing it things work. Well that's no good solution.

You then head back to google and scrounge some more and eventually find out that ffmpeg doesn't put in some metadata in the video file that is helpful to players. The most critical bit of data being how long the video is.

You then google some more and find a number of ways to do this and settle on yamdi. This is a simple app that does a simple thing:

yamdi -i ProjectKronos_test.flv -o ProjectKronos_final.flv

Basically you just give it an input file and an output file and it puts in the metadata flash players like.

That's about it.