[FFmpeg-user] Improve recording in .mp4 format

Massimo Battistel battistel at gmail.com
Mon Jun 30 18:57:14 CEST 2014

I usually record incoming streams with:

ffmpeg -i "udp://.." -vcodec libx264 -pix_fmt yuv420p -b:v 1M -preset
ultrafast -g 25 -acodec libvo_aacenc -ac 2 -ar 48000 -b:a 128k -f mp4

This works very well 99.9% of time, but there is a little issue: if ffmpeg
process suddenly terminates (typically for a power supply failure but also
task manager kill gives the same result), the file that was being written
is completely unreadable ("MOOV atom not found").

I tried with "-movflags faststart" but no luck, it seems that moov atom is
written to the begin of file only when ffmpeg terminates (properly).

I would like to know if it possible to generate a file that is someway
'recoverable'. I mean, the file that was being written should be readable
at least to some point (to minimize the lost).
.mp4 is not mandatory as choice, if other containers can solve this issue.


More information about the ffmpeg-user mailing list