Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

Thanks in advance.

share|improve this question
3  
Just for reference for others interested in placing the moov atom in the beginning to facilitate playback see the -movflags faststart option or the qt-faststart tool in ffmpeg. – LordNeckbeard Mar 1 '13 at 18:59
up vote 15 down vote accepted

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"
share|improve this answer
1  
Works a charm, thanks! Should also note that we do a little dance in the office every time you or LordNeckbeard make an appearance! – Jamie Taylor Mar 4 '13 at 9:06
    
Haha, well… glad to help :) – slhck Mar 4 '13 at 9:29
    
Note, this will not work on YouTube DASH files. – Steven Penny Apr 28 '14 at 7:43
1  
@StevenPenny Right, DASH segments do not contain the entire Atom tree, because they're only segments, not complete ISO Base Media files. – slhck Apr 28 '14 at 8:29

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)
$
share|improve this answer
    
If you have pip installed you can install qtfaststart with pip install qtfaststart – qff Apr 19 at 11:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .