Home / Repair guides / untrunc online
untrunc online: repair truncated MP4 and MOV files without the command line
untrunc is the free, open-source tool that made reference-based video repair popular: give it a healthy video from the same camera and it rebuilds the missing index of a broken one. This page explains how to run it yourself, what it needs to work, and the online alternative if you would rather upload the file than compile and run a tool.
What untrunc does
MP4 and MOV recordings keep the compressed video and audio in one part of the file and the index in another. The index, called the moov atom, lists every frame, the duration and the codec settings, and most cameras write it when recording stops. If the battery dies, the camera crashes or a copy is cut off, the frames are there but the index is not, and players report errors such as “moov atom not found”.
untrunc rebuilds that index. It reads a healthy video recorded with the same camera and settings, learns how that camera describes its video and audio streams, then scans the broken file frame by frame and writes a new, playable file.
The original tool was written by Federico Ponchio (ponchio/untrunc on GitHub). The actively maintained fork by anthwlock (anthwlock/untrunc) is the one most people use today. According to its README it is more than ten times faster, handles files over 2 GB, can skip over unknown bytes and supports GoPro and Sony XAVC videos. Both are free software under the GNU General Public License.
How to run untrunc yourself
Windows
The anthwlock fork publishes ready-made 32-bit and 64-bit Windows builds on its GitHub releases page, and they include the optional graphical interface. Download them from there, not from third-party sites.
Mac
There is no ready-made Mac app and no Homebrew package. The README builds it from source after installing ffmpeg and yasm with Homebrew, and the project wiki describes running it with Docker Desktop instead. Mac users regularly report build problems, so expect some trial and error.
Linux
Build it from source with the FFmpeg development libraries, use the included Dockerfile, or install the untrunc-anthwlock snap.
The command
Put the healthy file first and the broken file second:
untrunc /path/to/working-video.mp4 /path/to/broken-video.mp4
If it succeeds, it writes a new file next to the broken one, named like broken-video_fixed.mp4. A few options from the program’s help are worth knowing:
-s: step through unknown sequences, useful when the file contains damaged or unexpected data;-k: keep unknown sequences instead of dropping them;-sv: stretch the video to match the audio duration (marked beta);-dst: choose where the repaired file is written;-v: detailed output, which the maintainer asks for when you report a problem.
What untrunc needs to work
- A matching reference file. The README asks for a working video “ideally from the same camera, if not the chances to fix it are slim”. In practice, record it with the same settings as well: resolution, frame rate, format and recording mode.
- The frames must still be in the file. untrunc rebuilds the index around data that exists. It cannot recover footage that was never written, was overwritten or is missing from a recovered file.
- Work on a copy. Keep the original damaged file untouched so you can try again with another reference or another tool.
- Check the whole result. A file that opens is not necessarily complete. Watch the beginning, middle and end, and check that the sound stays in sync.
When untrunc struggles
The project’s issue tracker shows the cases that most often go wrong:
- Action cameras that lost power in the cold or mid-write: users report only some files repaired, or repaired files much smaller than expected.
- A short reference for a long recording: results can be worse when the broken video is much longer than the healthy one.
- Audio out of sync: some audio formats carry no frame boundaries, so their timing has to be estimated.
- Badly damaged cards: when the data itself is damaged, untrunc may find no frames at all (“Found 0 packets”).
Trying a longer reference recorded with exactly the same settings, or the -s option, sometimes helps. When it doesn’t, the problem is often the data rather than the tool.
Running untrunc yourself or repairing online
| What matters | untrunc on your computer | FrameRescue online |
|---|---|---|
| Cost | Free | €5.00 per repaired file, only if a repaired file is ready |
| Setup | Windows download; build from source on Mac and Linux | Nothing to install: upload in the browser |
| Reference video | Required | Helpful but optional |
| Privacy | The file never leaves your computer | The file is uploaded for processing |
| Checking the result | Up to you | Decoded and checked before it is offered, with a preview |
If you are comfortable with a terminal and have a good reference file, try untrunc first: it is free and it works well when the reference really matches. If you would rather not install anything, don’t have a reference, or untrunc did not manage, upload the file to FrameRescue.
FrameRescue is not affiliated with the untrunc authors. Its repair pipeline includes untrunc (the anthwlock fork, free software under the GNU GPL) alongside its own reconstruction methods and checks.
Questions about untrunc
Is there an online version of untrunc?
The untrunc project itself is a program you run on your own computer. Some websites offer repair based on the same approach, in the browser or by upload. FrameRescue’s repair pipeline includes untrunc together with its own reconstruction methods, so you can upload the file instead of building and running the tool.
Does untrunc work on Mac?
It can, but there is no ready-made Mac app or Homebrew package. You build it from source using Homebrew for its dependencies, or run it with Docker Desktop as the project wiki describes. Windows users can download ready-made builds that include a simple graphical interface.
Why does untrunc need a working video?
A truncated file has its video and audio frames but not the index that describes them. untrunc learns how the camera describes its streams from a healthy file recorded with the same camera and settings, then uses that to find and index the frames in the broken file.
What if I don’t have a reference video?
Record a short new clip with the same camera, using the same resolution, frame rate and mode. Without a reference from the same camera, the README warns that the chances are slim. FrameRescue keeps reference profiles of its own for common devices, so a healthy clip is helpful but not required.
Why did untrunc only repair some of my files?
Usually because the damage goes beyond the missing index: data written while the camera was losing power can be incomplete or corrupted, and a reference that is much shorter than the broken file or recorded with different settings makes matching harder. Try a longer reference with identical settings and the -s option.
Is untrunc free and safe to use?
untrunc is free software under the GNU General Public License. Running it locally means your video never leaves your computer. Download it only from the project’s official GitHub pages, and always run it on a copy of the damaged file.
Related repair guides
- Repair a truncated MP4
Recording interrupted or copy cut off? How to tell, and when a reference-based repair is needed.
- Fix “moov atom not found”
What the missing movie index means and why copy or faststart commands don’t rebuild it.
- Video shows 0 seconds
0:00 with a large file size is usually repairable; 0 bytes is not. How to tell, free fixes and repair.
- Phone died while recording
Does the video save? Where to look on iPhone, Android and cameras, and how to repair the unfinished file.
Rather not use the command line?
Upload the original damaged file. A healthy clip from the same device is optional. FrameRescue checks the result before offering it, and you pay €5.00 only if a repaired file is ready.