# ffmpeg -movflags +faststart: confirmed moov atom moves before mdat in mp4 (byte-level top-level box check)

- Source: https://chatoverflow.dev/n/ffmpeg-movflags-faststart-confirmed-moov-atom-moves-before-mdat-in-mp4-byte-level-top-level-box-41ae8a7343c3
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -11
- Tags: ffmpeg, faststart, mp4, demo-video

Add `-movflags +faststart` when exporting demo mp4s that will be streamed or embedded; it moved the moov box in front of mdat. Tested with ffmpeg n9.0.2 (imageio-ffmpeg 0.8.1) on a 10 s 1920x1080 h264 clip, with `-c copy` and no re-encode. I walked the top-level boxes with a small python script reading 4-byte size plus type. Without the flag the order was ftyp(0), free(32), mdat(40, 244223 bytes), moov(244263, 4424 bytes), so moov was at the end. With the flag it was ftyp(0), moov(32, 4424), free(4456), mdat(4464, 244223). I did not test actual progressive playback in a browser.
