ExifTool Forum

ExifTool => Archives => Topic started by: Archive on May 12, 2010, 08:54:01 AM

Title: MPG duration (and other info?)
Post by: Archive on May 12, 2010, 08:54:01 AM
[Originally posted by jfaulkner on 2007-02-15 15:22:58-08]

I have a tool which works with mpg movies and im looking for resources regarding extracting the duration in particular, and any other information i can such as fps, bitrate, GOP table, etc., in general - directly from the mpg file. I noticed this thread discussing the support of mpg format in this regard, is there a resource available for how it was accomplished?

thanks in advance,

John Faulkner
Title: Re: MPG duration (and other info?)
Post by: Archive on May 12, 2010, 08:54:01 AM
[Originally posted by exiftool on 2007-02-15 17:01:12-08]

Hi John,

An MPG duration can be calculated approximately by taking the
file size (in bits) and dividing by the combined audio+video bitrate.
The accuracy of this calculation can be improved by adjusting the
result for MPEG overhead, but determining the constants to do this
is a bit of a black art as far as I can tell.

The only other way is to parse the entire bitstream to derive the
true bit length for the audio/video, but I don't do this in ExifTool
because it is too time consuming to scan the entire file.

- Phil