Flash/Video


In the vein of my Darwin/Streaming Server notes, here's an ffmpeg incantation to transcode video to the Flash pseudo-streamable FLV format (taken from here):

$ ffmpeg -i movie.dv -f flv -r 12 -me full -subq 5 -mbd 1 -b 150 \
-qmin 2 -qmax 31 -s 360x240 -acodec mp3 -ar 11025 -ab 16 -ac 1 video.flv

This will create a Flash video with settings of 12fps, 360 by 240 pixels, 150 video bitrate, and a 16 bitrate mono audio track (...)

To insert suitable hints and metadata, you need flvtool2 (requires Ruby):

flvtool2 -u video.flv

Another alternative is apparently to use mencoder, which is supposed to generate better quality output:

mencoder input.dv -ofps 12 -o video.flv -of lavf -lavfopts \
i_certify_that_my_video_stream_does_not_use_b_frames -oac lavc -lavcopts \
acodec=mp3:abitrate=32 -srate 22050  -ovc lavc -lavcopts vcodec=flv:\
vbitrate=100:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:\
vmax_b_frames=0:vb_strategy=1:precmp=2:cmp=2:subcmp=2:preme=2:qns=2 \
-vop scale=360:240