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.

1 Answer 1


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.

  • Thanks Synetech. I have another question: When you say it would be pointless to wait until the whole video has been processed to find out such a basic piece of information, do you mean waiting on the production writing side, or the end-user reading side? (Also, do you know if .TS file contains a total-length metadata field?)
    – user33666
    Mar 2, 2011 at 5:25
  • I mean on the end-user side. The production side should already know how long the video is. On the client side, finding out exactly how long the video is at the end of the video (ie by having the program run through the whole video before to calculate the length) would not be very useful. I don’t know about MPEG transport streams, but I’m sure it can be found out (I don’t believe the format is proprietary). I’ll see if I can find a format specification.
    – Synetech
    Mar 2, 2011 at 22:54
  • Added a bit of extra info about some formats that use keyframes.
    – Synetech
    Mar 2, 2011 at 23:02
  • Thank you Synetech. Where did you place the bit of extra info?
    – user33666
    Mar 6, 2011 at 19:15
  • You can see the revisions by clicking on the edited link: superuser.com/posts/252052/revisions
    – Synetech
    Mar 6, 2011 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.