Once the camera module has captured video, you are left with an raw H264 file. Now, some players can already play this but what you really want to do is convert it to a common format like MP4. (This is actually ‘wrapping’ the H264 output inside an MP4 ‘container’, but we’ll call it conversion…)
First of all, take a video:
raspivid -fps 30 -o raw.h264 -t 20000
ffmpeg -r 30 -i raw.h264 -vcodec copy converted.mp4
And there you have it – an MP4 file. Now, I’m not convinced that this will produce a standards-compliant MP4. There seems to be some debate about whether you’ll be able to use it, for example, in a video editing package such as Pinnacle, however, the MP4 should play in most video player software and you should be able to upload to YouTube.
You can produce a FLV (or Flash) file by changing ‘converted.mp4′ to ‘converted.flv’.