Using FFmpeg to locate moov atom

I have a library of videos, all of which should have been adjusted for web-streaming by putting the moov atom ahead of the rest of the video. This allows playback to begin before the client has completely downloaded the video.

Is there a reliable way to check if a certain video has been adjusted by locating how many bytes in the moov atom occurs? This is for debugging purposes only.


FFmpeg won't show you this information, really.

You could use AtomicParsley to parse the file, e.g.:

AtomicParsley input.mp4 -T 

This will show you the location of the atoms in a tree. If the moov atom is at the beginning of the file, it'll have to come right after the ftyp atom, so you could try parsing the output, e.g. in Bash, only printing the second line and checking whether it contains moov:

AtomicParsley input.mp4 -T | sed -n 2p | grep -q "moov" && echo "yup" || echo "nope"

Using this qtfaststart (not the same as ffmpeg's qt-faststart), qtfaststart -l input.mp4 will display the order of the top-level atoms.

$ qtfaststart -l bad.mp4
ftyp (32 bytes)
free (8 bytes)
mdat (559619 bytes)
moov (52916 bytes)
$ qtfaststart -l good.mp4
ftyp (32 bytes)
moov (52916 bytes)
mdat (559619 bytes)
$