Stream your movies using Flash
May 1st, 2007
I spent way too much time searching before I found out how easy it is. All you need is ffmpeg (or ffmpegX on Mac) and JW FLV Player. The flvplayer.swf file must be accessible on your website.
Two steps:
- Convert your AVI/MPEG/whatever to FLV, the format that the Flash player will read:
ffmpeg -i mymovie.avi -s 320x240 mymovie.flv
Obviously you can choose any size, 320×240 is just what I use.
- Embed it on your site using normal, everyday HTML:
<object type="application/x-shockwave-flash" width="320" height="240" wmode="transparent" data="flvplayer.swf?file=file=path/to/mymovie.flv&autoStart=true"> <param name="movie" value="flvplayer.swf?file=file=path/to/mymovie.flv&autoStart=true" /> <param name="wmode" value="transparent" /> </object>
The FLV player has many, many nicer ways to use it, this was just the shortest and simplest (though not recommended).
Edit: you should probably have LAME installed with ffmpeg compiled against it, then encode downsampling the audio as well. Here’s possibly a better way; i haven’t tested it, but should encode to a decent filesize:
ffmpeg -i movie.avi -ar 22050 -ab 56 -aspect 4:3 -b 200 -r 12 -f flv -s 320x240 -acodec mp3 -ac 1 movie.flv


