#11530 closed defect (wontfix)

Corrupted MP4 due to unfinished "moov atom" writing

Reported by: Innokentiy Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords: mov
Cc: Innokentiy, MasterQuestionable Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Innokentiy)

i am trying to accomplish recording process from camera to file, that will sustain to emergency powerdown. That occurs in some circumstances.

i am trying to make it via library, and here i introduce the utility example, what have same problem, in my opinion.
i've generated test1.mp4
ffmpeg -f lavfi -i testsource=d=100 test1.mp4
and then trying to copy it to test2.mp4
ffmpeg -y -i test1.mp4 -avioflags direct -fflags +flush_packets -movflags +frag_keyframe -use_editlist 1 -moov_size 4000 test2.mp4
while it works i abort it work via ctrl+C.

if 2nd command finishes correctly - test2.mp4 can be played
if 2nd command aborted - test2.mp4 can't be played

i figured out, that there is missed free atom between ftyp and moov, if i restore it - file plays normally.
i think missing free atom is a bug

ffmpeg versions i've tried:
5.1.6 built with gcc 12 (Debian 12.2.0-14) and 7.1 built with gcc 14.2.0 (Rev1, Built by MSYS2 project)

Change History (3)

comment:1 by Innokentiy, 18 months ago

Description: modified (diff)

comment:2 by MasterQuestionable, 18 months ago

Cc: MasterQuestionable added
Keywords: mov added; mp4 mux movenc.c removed
Summary: nonrobust muxer workCorrupted MP4 due to unfinished "moov atom" writing

͏    Inherent unreliability of MP4. ("moov atom")
͏    https://github.com/MasterInQuestion/talk/discussions/3#issuecomment-1546820018-4

͏    Probably no reliable fix viable.
͏    (unless consider not using MP4)

comment:3 by compn, 17 months ago

Resolution: wontfix
Status: newclosed

yeah known problem with incomplete mp4 files and cameras everywhere. dont use mp4. use mkv.
mkv will playback even if incomplete.

Note: See TracTickets for help on using tickets.