[FFmpeg-user] Improve recording in .mp4 format
ffmpeg-user at c-14.de
Mon Jun 30 19:42:53 CEST 2014
On 30/06/14 at 18:57, Massimo Battistel wrote:
> 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.
Try using .mkv. It just works.
More information about the ffmpeg-user