[vlc-devel] Re: duration of a mpeg2 file !

Måns Rullgård mru at inprovide.com
Thu Mar 10 23:09:55 CET 2005


Alain Costanza <costanza at EIG.UNIGE.CH> writes:

> Hello,
>
> I am looking for a way to find out the duration of a mpeg2 file in C++
> or Java. I found nothing on internet about this topic and I need it
> for my project in my school. May I ask you if you have a solution for
> that ? A class or anything else ...

The only reliable way is to parse the entire file.  In many cases, you
can get away with checking the first and the last timestamp.  If these
would imply an unreasonable bitrate (e.g. > 100Mbps), do a binary
search for timebase discontinuities.

-- 
Måns Rullgård
mru at inprovide.com

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list