I'm using ffmpeg on my Raspberry Pi (running on Raspbian) to record a 5 seconds long video at 12 fps from my webcam. It's not the Raspberry Pi dedicated webcam, just a regular USB one. This is the command I use:
sudo ffmpeg -f video4linux2 -s 640x480 -r 12 -vframes 60 -i /dev/video0 /mnt/ramdisk/output.mp4
The outcome is fine, but the time it takes is unacceptable. For this tiny 5 seconds long 640x480 clip, it takes about 2 minutes to complete converting and everything. I understand that the Pi is not exactly a beast of a computer, but I think it really could do better. As you can see, I use a ram disk to eleminate the bottleneck of the SD card I/O, but even so, it's very slow.
Do you have any ideas on how to make this faster?
I know about
streamer, it does a great job and it's very fast (the file is almost immediately available after the recording was finished), but unfortunately I could only get it to output avi format, which is not what I need. I need the recording to be either mp4 or mov format. I know that
streamer can theoretically output mov, but I couldn't get it to do so.
So basically I need a solution that's able to record footage from
/dev/video0 and output it in mp4 or mov format relatively fast.