When a MOV file is left with a missing moov atom, the video data is often still on the disk. The index that tells players where everything is has vanished. Repairing it with a reference file, also called a sample file, is the standard approach. Find a healthy clip recorded on the same device with the same codec, resolution, and frame rate. The repair tool copies the structural parameters from that sample to rebuild the index in your broken file. The free tool untrunc does exactly this. It is the core of most serious MOV and MP4 recovery workflows.

Why a Reference Video is Needed

During normal recording, a camera writes video frames into the mdat section of the file first. Only at the end does it write the moov atom that contains the index. If the recording is interrupted by a power loss, a crash, or a card removal, the moov is never written. The frame data is still there. Without the index, players and editors see a corrupted or unplayable file.

A reference video provides the missing structure. The repair tool reads the codec parameters from the healthy sample: resolution, frame rate, and audio configuration. It then scans the broken file to find the actual frame data and uses that information to build a new moov atom. This is why the reference must be as close as possible to the broken file. A mismatched reference produces garbage video or fails entirely.

How to Choose a Reference Video

What Must Match

The reference must match the broken file in several key ways:

  • Resolution: The same width and height, for example a common high-definition size.
  • Frame rate: The same number of frames per second, such as 30 or 60.
  • Codec: The same video codec. H.264, HEVC, or ProRes. An H.264 reference will not help a HEVC file.
  • Audio configuration: The same audio codec, sample rate, and channel count.

Getting the Match Right

The reference should come from the same device and from a time close to when the broken file was created. A short clip of a few seconds is enough; you do not need a long recording. The key is that the parameters are identical. If you change any setting, such as switching from H.264 to HEVC, record a new reference clip.

Where to Get a Reference Video

If you have another healthy clip from the same camera and the same session, use that. If not, record a new short clip before you change anything. For example, if your camera is set to 4K at 30fps with H.264, record a few seconds of a plain scene with those exact parameters. Save that clip on your computer. Keep it as a reference for future repairs.

You might try to find a reference online, but that is risky. The reference must match precisely. A clip from a different camera model or with different parameters will not work. Record your own reference whenever possible.

Using Untrunc to Repair the File

untrunc is a free, open-source command-line tool that does this job. The original project is ponchio/untrunc, and the actively maintained fork is anthwlock/untrunc on GitHub. The basic usage is simple:

  1. Download and build untrunc from the anthwlock/untrunc repository. Follow the build instructions for your operating system.
  2. Copy your broken MOV file to a safe location. Always work on a copy, never the only original on the memory card.
  3. Open a terminal or command prompt.
  4. Run the command: untrunc reference.mov broken.mov
  5. Wait for the tool to finish. It scans the broken file and writes a repaired version, usually with a _repaired suffix.

After the repair, play the output file to verify that the video and audio are correct. If the repair fails, check that the reference matches the broken file in every required parameter.

What to Do If the Repair Fails

If untrunc reports an error or produces a file that still does not play, the most likely cause is a mismatched reference. Double-check the resolution, frame rate, codec, and audio configuration. If you changed any of these between the reference and the broken file, find a better reference.

Another possibility: the broken file has no recoverable frame data. If the file size is 0 bytes or the file is all zeros, there is nothing to repair. No reference can help because the mdat section is empty. In that case, the data is lost permanently.

Preventing Future Corruption

The best way to deal with a missing moov atom is to avoid it. Eject memory cards properly. Use a card reader that does not interrupt power. Keep your camera battery charged. If your recording device allows you to finalize the file, do that before removing the card.

Keep a reference clip from each camera and parameter combination you use. Store it in a safe place on your computer or in cloud storage. When a corrupted file appears, you have a matching sample ready for repair.