moov atom not found means the MP4 has no index, usually because the file was cut off, and ffmpeg 8.1 exits with code 183. Repair it with untrunc; a +faststart remux on ReelSDK, at $0.02 per compute minute, keeps the next file readable.
moov atom not found
We cut a 5.5 MB, 11-second recording in half, with its moov at the end: every frame in the first half was there, but ffmpeg had no index to find them. On ReelSDK the cut file failed too, with HTTP 422 and no charge.
ErrorsUpdated
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558484b5bfc0] moov atom not found [in#0 @ 0x558484b5bdc0] Error opening input: Invalid data found when processing input Error opening input file upload.mp4. Error opening input files: Invalid data found when processing input
Source: ffmpeg mov, mp4 muxer docs, checked November 2026.
Where it shows up
ffmpeg fails while it opens the input
You open an MP4 that is incomplete: an upload or download that stopped early, a recording whose app or camera died, or a file still being written. We took a 5.5 MB recording with the moov at the very end, kept its first half and ran ffmpeg -i upload.mp4 -c copy out.mp4.
ffmpeg 7.1 prints [mov,mp4,m4a,3gp,3g2,mj2 @ 0x...] moov atom not found; ffmpeg 8.1 prints the same text with an [in#0 @ 0x...] prefix. Both follow it with Invalid data found when processing input and exit with code 183. ffprobe fails the same way, with code 1.
Why it happens
The moov box is the index, and it is written last
An MP4 keeps its frames in an mdat box and its index in a moov box: codecs, frame sizes, timestamps and where each frame starts. Without the moov, the mdat is a run of bytes nobody can split into frames.
ffmpeg's mp4 muxer can only finish the moov once it has seen every frame, so by default it writes it at the end; +faststart is a second pass that moves it to the front. Cut the file anywhere before that and the moov is gone, even though most of the media is intact. Ours was only about 12 KB at the very end of a 5.5 MB file, and without it none of the frames could be read.
Causes and fixes
Why the moov is missing, and the fix
| What happened | What is left | Fix |
|---|---|---|
| Upload or download cut off | The media up to the cut, no moov | Fetch the whole file again, or untrunc |
| Recorder crashed or was killed | A plain mp4 with no moov | untrunc now; fragmented MP4 or MKV next time |
| File still being written | No moov yet | Wait until the writer closes it |
| MP4 piped into stdin, moov at the end | A different error: partial file | +faststart before you pipe, or pass a file path |
| +faststart file cut off | The moov, plus the frames before the cut | -c copy keeps what is there |
Source: ffmpeg mov, mp4 muxer docs, checked November 2026.
The local fix
Get the whole file, or rebuild the index
First check the size against the source and fetch it again if you can: a whole file has its moov. If the rest is gone for good, untrunc rebuilds the index from a working video recorded with the same camera or app. With the whole file as reference, untrunc rescued about 4 seconds of the cut copy almost instantly, and ffmpeg decoded the result cleanly.
To keep it from happening again, put the moov first or avoid one big index. A +faststart copy cut at the same byte still opened and kept what came before the cut. For recordings, fragmented MP4 or MKV survive a crash: after a kill -9 10 seconds into a recording, the plain mp4 had no moov, while the fragmented MP4 and the MKV each kept about 9 seconds.
# untrunc: a working file from the same camera or app, then the broken one
untrunc working.mp4 broken.mp4
# writes broken.mp4_fixed.mp4# move the moov to the front of a whole file, no re-encode
ffmpeg -i in.mp4 -c copy -movflags +faststart out.mp4# fragmented MP4: each fragment carries its own index
ffmpeg -i input -c:v libx264 -g 60 -c:a aac -movflags +frag_keyframe+empty_moov rec.mp4
# or record to MKV and remux when it is done
ffmpeg -i rec.mkv -c copy -movflags +faststart rec.mp4Skip the binary
Or let the API put the moov first
No server can rebuild a moov that was never written: we sent the cut file to POST /v1/ffmpeg and the job failed with HTTP 422 and FFMPEG_FAILED, at no charge. What the API does is the +faststart remux, on ffmpeg 8.1 on a fresh machine per job.
On the whole file, -c copy -movflags +faststart moved the moov from the end to the front and finished in about 3 seconds. At $0.02 per compute minute, billed per second, that cost under a fifth of a cent.
const res = await fetch("https://api.reelsdk.com/v1/ffmpeg?wait=60", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.REELSDK_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"inputs": {
"in.mp4": "https://api.reelsdk.com/f/lib/in/errors/moov-at-end.mp4"
},
"args": ["-i", "in.mp4", "-c", "copy", "-movflags", "+faststart", "out.mp4"],
"outputs": ["out.mp4"]
}),
});
const { job } = await res.json();-movflags +faststart on the API, with its moov now at the front.Input: moov-at-end inputPiping an MP4 into ffmpeg
If you stream an upload into ffmpeg -i pipe:0 from Node or Python, ffmpeg cannot seek ahead to a moov at the end. With our whole moov-at-end file on stdin, it printed partial file and Cannot determine format of input 0:0 after EOF and exited with code 183. The +faststart copy of the same file went through stdin with exit code 0.
So either save the upload to disk and pass the path, or make the sender write +faststart files. A truncated upload to disk still gives moov atom not found, which tells you the transfer stopped early.
FAQ
Questions, answered
Can ffmpeg repair a file with no moov atom?
No. ffmpeg needs the moov to find the frames, so every command on the file fails the same way. untrunc rebuilds the index from a working file made by the same camera or app; on our cut copy it rescued about 4 seconds of video.
What does -movflags +faststart do?
It runs a second pass that moves the moov to the start of the file, with no re-encode. A pipe can then read the file, and a copy cut off midway still opens with the frames before the cut: our cut +faststart copy kept its first 4 seconds.
Why did my recording lose its moov?
The recorder writes the moov when it closes the file. A crash or a kill before that leaves media without an index. Fragmented MP4 (+frag_keyframe+empty_moov) or MKV keep a crashed recording readable.
Can the API fix a cut-off file?
No. The missing index is not on any server: our cut file failed with HTTP 422 FFMPEG_FAILED, and failed jobs are not billed. Send the whole file, and the API can remux it with +faststart.
- Add faststart to an MP4 with ffmpegMove the moov atom to the front of an MP4 with -movflags +faststart so it plays before the download ends, and check where it sits.
- ffmpeg exited with code 1: Conversion failed!fluent-ffmpeg reports only ffmpeg's exit code and last line. The real cause is in stderr: print it, or use -v error to see it alone.
- Non-monotonous DTS in output streamPackets reach the muxer with timestamps that go backwards, often from joining unlike clips with -c copy. Re-encode with the concat filter.
- Error: spawn ffmpeg ENOENTNode cannot find an ffmpeg program on PATH. Install it, spawn the ffmpeg-static path, or send the same args to an API.
- Convert MOV to MP4 with ffmpegRemux an H.264 MOV to MP4 with -c copy in a fraction of a second, and transcode ProRes, which MP4 can't hold, to H.264.
- Convert MKV to MP4 with ffmpegRemux MKV to MP4 without re-encoding, keep the subtitles as mov_text, and avoid the -c copy that drops them without a word.
- Video conversionConvert WebM, MKV or MOV to MP4 and back in one ffmpeg call, about a third of a cent for a 30 s clip.
- FFmpeg onlineRun your own ffmpeg command on your files in the browser, free and without installing or uploading anything.
Sources, checked November 2026
Ready to build?
Ship video from your app today
Your first $0.50 is free, and one key covers every endpoint.
