Search code examples
videoffmpeg

Detect if "faststart" has been applied to video


When running "qt-faststart" on an MP4, you're essentially taking the meta data from the back and placing it at the front of the file. In my case, so Flash can properly start playing the video before it's fully done loading.

I have a large number of videos that I'm running through a shell script to encode overnight. When I upload, however, I won't necessarily know in my final folder of videos (on the server) have "qt-faststart" run on it.

My goal is to find the straggler videos and run qt-faststart on them manually, but I'll need a way to compile a list. Is there any way to check for this meta data information with PHP or something? Wondering how I can tell if a video has already had qt-faststart run on it or not.


Solution

  • It shouldn't do any harm to run qt-faststart more than once, it will be a no-op the second time. So the easiest solution is to always run qt-faststart.

    For more precise control, I would use the Python translation of qt-faststart: https://github.com/danielgtaylor/qtfaststart

    It has functions that examine the atoms in an MP4 file, it shouldn't be too hard to use them to determine whether they need to be reordered.