Satya's blog - Webcam images to Flash FLV on Linux

Oct 23 2006 19:44 Webcam images to Flash FLV on Linux

Okay, here's how to convert a series of images, say from a web cam, to flash video. On linunx, no less. This little trick uses mencoder and flvtool2 (the latter is a ruby script). Here's the command:

mencoder "mf://*.jpg" \
-ofps 25 \
-o test.flv \
-of lavf \
-ovc lavc \
-lavcopts vcodec=flv:keyint=50:vbitrate=600:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 \
-vop scale=320:240 \
-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames

Follow that up with flvtool2 -UP test.flv. Then you will need a Flash video player, such as the one from Jeroenwijering.com. That one's free for non-commercial use.

So make an HTML file with content similar to:

<html>
<body>
<object type="application/x-shockwave-flash" width="320" height="220" wmode="transparent"
data="flvplayer.swf?file=test.flv&autostart=false">
<param name="movie" value="flvplayer.swf?file=test.flv&autostart=false" />
<param name="wmode" value="transparent" />
</object>
</body> </html>

...and Bjorn Stronginthearm's your uncle.

Update: I got instructions from Homo-Adminus Blog which helped me. Also, if you want sound you need to add this to the mencoder command line:

-oac mp3lame \
-lameopts abr:br=64 \
-srate 22050 \

Tag: geeky howto