The moov atom is the file's index
An MP4 or MOV file is a chain of boxes, which Apple's QuickTime documentation calls atoms. Two of them hold your recording. The mdat box carries the compressed video and audio, packet after packet, with no markers between them. The moov box describes that data, track by track, in a sample table:
| Box | What it records |
|---|---|
| stsz | the size of every video frame and audio packet |
| stco or co64 | where each run of frames starts in the file |
| stts and ctts | how long each frame lasts and the order to show frames in |
| stss | which frames are keyframes |
| stsd | the codec setup: avcC for H.264, hvcC for H.265, esds for AAC |
The avcC and hvcC entries hold the parameter sets (SPS and PPS, plus VPS for H.265) that a decoder must read before it can draw the first picture. Without moov, a player sees one long run of bytes with no frame boundaries, no clock and no decoder settings. ffmpeg reports that as moov atom not found.
The index takes little space. In a 6-second test clip we exported with ffmpeg, moov used 7,845 bytes of a 694,482-byte file.
Why the index goes missing
A camera can't write the index during the recording, because the index lists the size and position of frames that don't exist yet. It streams frames into mdat and writes moov at the end, when you press stop. Phones, action cameras, drones and dashcams record this way, and ffmpeg's MP4 output does the same with its default settings.
Cut the recording before that last step and the file ends with frames and no index:
- the battery dies mid-recording
- the camera app, the recording program or the computer crashes
- someone pulls the memory card or unplugs the drive
- a dashcam loses power when the engine stops
You get the same message for a file that never finished arriving: a copy that stopped halfway, or a recording you open while the camera is still writing it. If the original still exists, copy it again before you repair anything.
Confirm it before you repair
Run ffprobe, which comes with ffmpeg:
ffprobe broken.mp4
A file with frames and no index prints:
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001e4338737c0] moov atom not found
broken.mp4: Invalid data found when processing input
ffmpeg -i broken.mp4 stops on the same line. VLC opens the file and ends playback at once, with nothing on screen.
The message alone doesn't prove your footage survived. We ran ffprobe on a 0-byte file and on a 5 MB file of zeros, both named .mp4. Both gave moov atom not found, with one extra warning first:
Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
That warning means ffmpeg found no MP4 structure and picked its MP4 reader from the file name alone. A 0-byte file, or one that triggers the warning, holds no footage, and no tool can rebuild it. A file whose size fits the length of the recording, with no warning, points to the case a repair can fix: frames on disk, no index.
Free tools: untrunc and recover_mp4
Two free programs rebuild a missing index. Both need a healthy reference video from the same camera, and both expect you to be at ease with technical tools.
untrunc is open source. You give it the working clip and the broken one:
untrunc working.mp4 broken.mp4
The anthwlock fork offers Windows builds with a basic graphical version; on Linux and macOS you install it and run it in a terminal. Its README warns that the chances are slim with a reference from a different camera.
recover_mp4 is a command-line tool that works in steps. recover_mp4 good.mp4 --analyze reads the healthy clip, a second run extracts the raw video and audio streams from the broken file, and you join them into a new MP4 with ffmpeg, typing the frame rate yourself. Its author no longer supports the downloadable version.
Rebuild the moov atom in your browser
The checker on this page runs the repair engine of the Video Repair apps for Android and Windows, compiled to WebAssembly. Your browser reads the video from your own disk, and the file never uploads.
- Drop the MP4, MOV, M4V or 3GP file into the tool above.
- The free check reads the footage and tells you whether it can rebuild the file. It works with H.264 or H.265 video and AAC sound.
- If your camera kept its settings only in the moov, the tool asks for a reference clip: any healthy video from the same camera at the same settings. That clip also brings the sound back when needed.
- Watch the free 5-second preview, at reduced quality with a watermark.
- Download the full video with a plan: one video, 3 months or a year, and you can cancel anytime. If the repaired video doesn't play, you get a refund.
The tool copies your camera's video and sound data byte for byte and writes a new moov around it. It re-encodes nothing. It can't rebuild a file that is empty or all zeros, bring back deleted or overwritten footage, open AVI, MKV, TS or WebM files, or decrypt videos hidden by a vault app.
