Method explained
How to repair an MP4 with a reference file
Every serious MP4 repair tool — untrunc, recover_mp4, Grau's Video Repair, StreamSalvage — is built on the same idea: use a healthy clip with identical settings as a template to rebuild a broken file's missing index. Understand the method once and every tool makes sense.
Why a broken MP4 needs a template
An interrupted recording is missing its moov atom — the index describing where every frame sits, how the streams interleave, and what the codec parameters are. The raw frames are still in the file, but there are many valid ways to interpret raw H.264/HEVC data, and guessing wrong produces garbage. A reference clip removes the guesswork: it was written by the same encoder with the same settings, so its structure tells the repair tool exactly how the broken file's data is laid out.
What makes a good reference file
| Must match | Doesn't matter |
|---|---|
| Device or app (same GoPro model, same OBS install) | Content — record your desk, a wall, anything |
| Resolution and frame rate (4K60 broken file → 4K60 reference) | Length — 10 seconds is plenty |
| Codec and encoder settings (H.264 vs HEVC, bitrate mode) | When it was recorded — old or new both work |
Best reference: another clip from the same recording session. Dashcams and drones make this easy — the previous loop segment or the clip before the crash is a perfect match.
Step by step
- Copy the broken file. All repair attempts happen on the copy.
- Get or make a reference. Use an existing healthy clip from the same session, or record a fresh 10-second clip with identical settings.
- Run the repair. Command line:
untrunc reference.mp4 broken.mp4. GUI: drop both files into StreamSalvage. - Check the result — full playback, audio/video sync, and the timeline scrubs correctly. Expect to lose the last few seconds before the interruption; those frames were never written.
Tool options
| Tool | Trade-off |
|---|---|
| untrunc (open source) | Free; command line, often needs compiling — see our untrunc guide |
| recover_mp4 | Free tier; command line, two-step workflow |
| Online repair services | Easy; requires uploading footage, size limits, pay to download |
| StreamSalvage | Drag-and-drop, 100% local, free preview, $29 one-time |
Reference repair, minus the command line
StreamSalvage guides you through recording a reference clip, tries a stream-copy first, then rebuilds the index locally. Preview the repaired file free — pay only if it works.
Download StreamSalvage for WindowsFrequently asked questions
What is a reference file in video repair?
A short, healthy, fully playable clip recorded by the same device or app with the same settings as the broken file. Its intact structure — codec parameters, sample tables, chunk layout — becomes the template for rebuilding the broken file's missing index.
What makes a good reference file?
Same device or app, same resolution, same frame rate, same encoder settings. It doesn't need to be the same content or length — 10 seconds is enough. A mismatched reference (different resolution or codec) produces an unplayable result.
Why does reference-file repair work when FFmpeg fails?
FFmpeg needs a parseable index to read the file; an interrupted recording has none. A reference tool doesn't need the broken file's index — it scans the raw data and reconstructs a new index using the reference clip's structure as a map.
Which tools can repair an MP4 using a reference file?
untrunc and recover_mp4 on the command line, Grau GmbH Video Repair and some online services with uploads, and StreamSalvage as a local drag-and-drop GUI with a free preview. All implement the same underlying idea.