StokeBloke.com

AVI to FLV with ffmpeg

I used to have all my videos on my website as divx or xvid encoded AVI. This is a pain as you have to download the files to play them.

I found FlowPlayer and it works really well. I used to use flvtool to encode videos as flv files but it is not part of gentoo and I had to keep manually downloading and building it all the time to get the updates.

I recently found this article which shows how to use ffmpeg to encode videos as flv files.

ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x256 video.flv

I then use the flv with FlowPlayer like this

<object type="application/x-shockwave-flash"
    data="/include/FlowPlayer.swf"
    width="320"
    height="284"
    id="FlowPlayer1">
  <param name="allowScriptAccess" value="sameDomain" />
  <param name="movie" value="/include/FlowPlayer.swf" />
  <param name="quality" value="high" />
  <param name="scale" value="noScale" />
  <param name="wmode" value="transparent" />
  <param name="allowNetworking" value="all" />

  <param name="flashvars" value="config={
		autoPlay: false,
		loop: false,
		initialScale: 'scale',
		showLoopButton: false,
		showPlayListButtons: false,
		playList: [
			{ url: '/media/tux_07.flv' }
		]
		}" />
</object>

See Hintertux 2007 for an example.

One Response to “AVI to FLV with ffmpeg”

  1. Perreault Says:

    Like the post! Thank you

Leave a Reply