Video – Understanding Properties and Details of Run-Time Length

videovideo capturevideo conversionvideo editingvideo streaming

When you take clips and turn them into computer playable files, whether .TS or .MOV or .MPG, .MP4, .VOB, etc., do you as the producer actually manually write into some field in a "Details" section of your video editor what the video length is, so that it can be read by the eventual user's video player? Or is this activity performed automatically by the video editor?

I'm asking because: when a mouse is passed over a file line item in Windows 7 Shell (Windows Explorer) a little box is displayed where the mouse meets the file line item and provides simple name and size properties, one of which (if it's a media file) is run length. How does that figure get there into the file (later to be read be Windows or OS X)?

Thanks for any info.

Best Answer

It depends on the format. Most contemporary video (and audio) formats tend to write some meta-data to the file in a header or other tag. Few formats need to be manually calculated because it would be pointless to wait until the whole video has been processed to find out such a basic piece of information.

Some formats use a middle-ground where they use markers like keyframes which, in addition to allowing the player to easily jump to various arbitrary points in the video, allow a program to quickly scan through the video (much faster than by scanning each frame), to get the total length (which may potentially be more accurate than meta-data in a header that could be modified to hold an incorrect length).

You can look up the specifications of a specific video format to find out exactly what meta-data, headers, and tags that format uses and supports.

Windows XP and earlier supported few formats by default (mainly WMV—surprise, surprise, MPEG, and AVI). Windows Vista/7 support a slightly wider variety, including MP4. You can get shell extensions like MediaInfo to get Explorer to support even more formats in the status pane/tooltips/properties dialog.

Related Question