Howto: Convert avi/mov/any video to Flash/flv on Linux

Recently I wanted to convert a Quicktime .mov video to Flash .flv in order to post it on this page, for the fun of it.
First thought: uuuh how do I do this on Linux? But it's pretty simple, thanks to ffmpeg. Works fine with anything that ffmpeg can play, so avi, mpeg, wmv or whatever.

It's as simple as:

ffmpeg -i input.avi -s 320x240 -ar 44100 -o movie.flv

There is also a nice tool to add metadata info like duration etc to flv files, called flvtool2.

cat movie.flv | flvtool2 -U stdin movie.flv

Now your flv has duration info and is ready for the website.