Properties!Details (run-time length)

1

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.

user33666

Posted 2011-03-02T02:03:11.573

Reputation: 357

Answers

2

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.

Synetech

Posted 2011-03-02T02:03:11.573

Reputation: 63 242

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 – 2011-03-02T05:25:36.953

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 – 2011-03-02T22:54:32.933

Added a bit of extra info about some formats that use keyframes. – Synetech – 2011-03-02T23:02:33.473

Thank you Synetech. Where did you place the bit of extra info? – user33666 – 2011-03-06T19:15:18.960

You can see the revisions by clicking on the edited link: http://superuser.com/posts/252052/revisions

– Synetech – 2011-03-06T20:06:57.890