Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
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 '11 at 5:25
    
MediaInfo is really useful. Thanks again. –  user33666 Mar 2 '11 at 6:16
    
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 '11 at 22:54
    
Added a bit of extra info about some formats that use keyframes. –  Synetech Mar 2 '11 at 23:02
    
Thank you Synetech. Where did you place the bit of extra info? –  user33666 Mar 6 '11 at 19:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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