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

ffmpeg 7.1, the first half of a 5.5 MB mp4, exit code 183
[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

Why the moov is missing, and the fix
What happenedWhat is leftFix
Upload or download cut offThe media up to the cut, no moovFetch the whole file again, or untrunc
Recorder crashed or was killedA plain mp4 with no moovuntrunc now; fragmented MP4 or MKV next time
File still being writtenNo moov yetWait until the writer closes it
MP4 piped into stdin, moov at the endA different error: partial file+faststart before you pipe, or pass a file path
+faststart file cut offThe 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.

repair.sh
# untrunc: a working file from the same camera or app, then the broken one
untrunc working.mp4 broken.mp4
# writes broken.mp4_fixed.mp4
faststart.sh
# move the moov to the front of a whole file, no re-encode
ffmpeg -i in.mp4 -c copy -movflags +faststart out.mp4
record-safely.sh
# 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.mp4

Skip 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.

faststart.mjsTry it
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();
The whole recording after -movflags +faststart on the API, with its moov now at the front.Input: moov-at-end input

Piping 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.

Ready to build?

Ship video from your app today

Your first $0.50 is free, and one key covers every endpoint.

Moonlit lake with a lit cabin under the mountains