MP4 "fast start" explained: why moov placement matters

By the FixMP4 engineering team · · 6 min read

If you have ever exported a video for the web, you have probably seen an option called fast start, web optimised, progressive download or, in FFmpeg, -movflags +faststart. It sounds like a speed setting. It is really about where one particular box sits inside the MP4 file, and the same box is the reason a recording that is cut off will not play at all.

The three main boxes

An MP4 (and its sibling MOV) is a sequence of boxes, also called atoms:

BoxContainsSize
ftypFile type and compatible brandsA few bytes
mdatThe compressed video and audio framesAlmost the whole file
moovThe index: codecs, frame sizes, positions, timestamps, keyframesUsually kilobytes to a few megabytes

A player needs the moov box first. Without it, the mdat is just a long run of bytes with no indication of where one frame ends and the next begins. We explain this in depth in what is the moov atom.

Two layouts

Moov at the end (ftyp, mdat, moov): what cameras, phones and screen recorders produce. The device writes frames as they are encoded and only appends the index after you press stop, because the index lists every frame and the device does not know the total until then.

Moov at the front (ftyp, moov, mdat): what fast start produces. After a file is complete, the tool rewrites it with the index first and updates all the frame positions inside the index, which shift by the size of the moved box.

Why streaming cares

When a browser plays an MP4 over HTTP, it downloads from the beginning. With moov at the front, playback can begin after a few kilobytes. With moov at the end, the browser must either download the whole file or make an extra range request to the end, which some servers and players handle poorly. That is why video platforms and web exports recommend fast start.

Why cut-off recordings break

Because recorders put the moov at the end, anything that stops recording abruptly (a dead battery, an app crash, a full card, a pulled cable) leaves a file with ftyp and a partial mdat but no moov. Players report "moov atom not found", "file not supported" or a duration of zero. See the full list of causes of corrupted recordings.

Fast start cannot help here: it is a post-processing step for complete files. There is no index to move.

Some recorders avoid the problem

Formats designed for live recording keep the index in small pieces along the way:

  • Fragmented MP4 writes a small index for every few seconds of video; see fragmented MP4 explained.
  • MKV and MPEG-TS can be played without a global index.
  • OBS hybrid MP4 combines fragment-style safety with a normal MP4 at the end.

These formats usually play up to the point of a crash.

Rebuilding a missing moov

When the moov never got written, it can be reconstructed from the frames themselves. A repair tool walks through the mdat, identifies where each video and audio frame begins and ends, takes the codec configuration from a reference file recorded with the same settings, and writes a fresh moov. The FixMP4 repair tool does this in your browser, and the file it writes puts the moov at the front, so the repaired file is already fast start and streams well.

Checking a file's layout

  • FFmpeg / ffprobe: run ffprobe -v trace on the file and look for the order of "type:'moov'" and "type:'mdat'" in the output.
  • MP4 box viewers such as MP4Box.js (web) or Bento4's mp4dump list the top-level boxes in order.
  • A hex viewer: the four-letter box names are readable as text near the start of each box.

Takeaways

  • Fast start moves the index to the front for streaming. It is harmless and useful for finished files.
  • Recorders put the index at the end, which is why interruptions break files.
  • A missing index can be rebuilt from the frames with a matching reference; read fix "moov atom not found" or try the repair tool.

Frequently asked questions

What does faststart do?

It moves the moov atom (the index) to the start of the MP4, so a player can begin playing before the whole file has downloaded.

Why do cameras write the moov atom at the end?

Because the index lists every frame, and the camera only knows all frames once recording stops.

Does faststart prevent corruption?

No. Faststart is applied after a file is complete. A recording interrupted before the end has no moov atom at all, wherever it would have gone.

Have a broken recording right now?

Diagnose it and hear or watch a free repaired preview. Nothing is uploaded.

Open the repair tool
  • moov atom
  • faststart
  • streaming
  • FFmpeg
  • MP4 structure