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’.
[…] recantha Once the camera module has captured video, you are left with an raw H264 file. Now, some players […]
Just a note – ffmpeg wasn’t installed on my Raspbian image so I presume its not a default package
I did sudo apt-get install ffmpeg to get it
Simon
And then it said ffmpeg was depreciated 🙂
And then the .mp4 only appears to have one frame 🙁
And then using avconv made no difference 🙁
Not winning with this one so far 🙂
Simon
That’s weird…
Definitely use avconv – it’s more up to date.
It’s definitely worked for me in the past… What are you using to view the MP4 after you’ve created it?
I tried many things 🙂 VirtualDub, quicktime, realplayer and VLC
Sounds like you’ve been on a similar journey to me!
Try following the steps here: http://raspi.tv/2013/how-to-shoot-video-and-convert-it-to-something-you-can-edit-in-pinnacle-and-other-programs
I’ll try that out on another Rpi