-c copy -movflags +faststart puts the moov atom up front with no re-encode; without it, the first 6 MB of a 13.6 MB MP4 wouldn't even open. If your app can't ship ffmpeg, ReelSDK does it for $0.02 per compute minute.

Add faststart to an MP4 with ffmpeg

ffmpeg writes an MP4's index, the moov atom, at the end unless told otherwise. ReelSDK's API fixed a 28-second, 13.6 MB file in about 5 seconds, download and upload included, with every frame left as it was.

GuidesUpdated

faststart
ffmpeg -i input.mp4 -c copy -movflags +faststart output.mp4

-c copy keeps every frame as it is and +faststart rewrites the file with the index first. A 28-second clip comes out the same size in a fraction of a second, with moov now ahead of the media data.

Variations

The other commands you will need

  1. Check where the moov atom is

    ffprobe's trace log lists the top-level atoms in file order. Our original printed type:'mdat' then type:'moov'; the fixed file printed them the other way round.

    check
    ffprobe -v trace -i output.mp4 2>&1 \
      | grep -o "type:'\(moov\|mdat\)'"
  2. Add it while you encode

    Every command that writes an MP4 for the web can carry the flag, so you never need the separate pass. ffmpeg moves the index after the encode finishes.

    encode
    ffmpeg -i input.mp4 -c:v libx264 -crf 23 -c:a aac \
      -movflags +faststart encoded.mp4

The flags

The flags in these commands

The flags in these commands
FlagWhat it doesUsed here
-movflags +faststartRuns a second pass that moves the moov atom to the startAll
-c copyCopies the streams without decoding, so only the container changesFaststart
-v traceMakes ffprobe log every atom it reads, in file orderCheck
grep -o "type:'...'"Keeps only the moov and mdat lines from that logCheck
-c:v libx264 -crf 23Re-encodes the video; the flag works the same with an encodeEncode

Sources: ffmpeg formats: mov, mp4 muxer options, ffprobe documentation, checked November 2026.

Why the moov atom ends up at the end

The moov atom is the index: it says where every frame sits in the file. ffmpeg only knows that once all the frames are written, so it puts the index after them. The ffmpeg documentation says it plainly: the data is usually written at the end of the file, but it can be moved to the start for better playback with +faststart.

A player reading from the start can't show a frame until it has the index. With moov at the end, it has to fetch the end of the file first or download the whole thing. YouTube's recommended upload settings ask for MP4 with the moov atom at the front, for the same reason.

What we measured

We cut both versions of our 28 s clip off after 6 MB, under half of the file. The original couldn't be opened at all: ffprobe answered moov atom not found. The faststart copy, cut at the same point, already told ffprobe the full duration, which is what a player needs to start.

Both files are the same size to the byte. Only the position of the index changes; the frames are the same bytes. That is why the fix needs no re-encode and took a fraction of a second.

Where faststart doesn't apply

The second pass rewrites the finished file, so the output has to be seekable. Writing MP4 to a pipe stops with muxer does not support non seekable output; write to a file first. The ffmpeg documentation also notes that the flag doesn't work with fragmented output, which has its index spread through the file anyway.

Faststart is about MP4 and MOV. WebM and MKV store their index differently, and the MOV to MP4 guide and MKV to MP4 guide add the flag while they remux.

Without installing ffmpeg

The same command as one API call

Send the same args to POST /v1/ffmpeg with the MP4's URL in inputs. Each job runs ffmpeg 8.1 on a fresh machine at $0.02 per compute minute, billed per second; this one finished in about 5 seconds, download and upload included, and cost under a fifth of a cent.

terminalTry it
curl "https://api.reelsdk.com/v1/ffmpeg?wait=60" \
  -H "Authorization: Bearer $REELSDK_KEY" \
  --json '{
    "inputs": {
      "input.mp4": "https://api.reelsdk.com/f/lib/in/guides/moov-at-end.mp4"
    },
    "args": [
      "-i", "input.mp4", "-c", "copy", "-movflags", "+faststart",
      "output.mp4"
    ],
    "outputs": ["output.mp4"]
  }'
output.mp4 from the API: the same 13.6 MB, with moov before mdat, so it starts playing before the download ends.Input: moov-at-end.mp4

FAQ

Questions, answered

What does -movflags +faststart do in ffmpeg?

It runs a second pass that moves the moov atom, the MP4's index, from the end of the file to the beginning, so a player can start before the whole file has downloaded. The frames themselves are not touched.

How do I check if an MP4 has faststart?

Run ffprobe -v trace -i file.mp4 and look at the order of the moov and mdat atoms. If moov comes first, the file is faststart. Our original listed mdat first; the fixed copy listed moov first.

Does faststart re-encode or change the quality?

No. With -c copy only the container is rewritten. Our file kept the same size and every frame, and the fix took a fraction of a second.

Why does ffmpeg say muxer does not support non seekable output?

MP4 needs to go back and rewrite parts of the file, and +faststart rewrites the whole thing at the end. A pipe can't be rewritten, so write to a file instead.

Can I add faststart to an MP4 without installing ffmpeg?

Yes. Send the same args to POST https://api.reelsdk.com/v1/ffmpeg with the MP4's URL in inputs. It runs ffmpeg 8.1 on a fresh machine per job for $0.02 per compute minute, billed per second, and failed jobs are free.

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