[Theora-dev] Question about number of frames in ogg/theora videofile.

illiminable ogg at illiminable.com
Tue Sep 27 15:13:33 PDT 2005


The short answer is you can't.

My directshow filters are actually silently scanning the entire file to find 
it's duration. Which is why if you open a really huge file, it will take a 
little while to load... since it's actually building a seek index at the 
same time.

In a single chained file... you need to search for the last page in each 
stream, get the granule pos, do the conversion to real time. And choose the 
higher value of all streams.

In a multi chain file (which you won't find many of anyway)... you need to 
binary search for all chain boundaries and do the above process for each 
chain... then add it all together.

Zen.
----- Original Message ----- 
From: "LS" <linesoft at plotinka.ru>
To: <theora-dev at xiph.org>
Sent: Tuesday, September 27, 2005 3:24 PM
Subject: [Theora-dev] Question about number of frames in ogg/theora 
videofile.


> Hello.
>
> How can I tell the number of frames in ogg/theora video file, without 
> actually reading the file? Or, how can I tell
> its playing time (which is basically the same thing).
>
> I didn't find the information in THEORA_STATE, THEORA_INFO, but with the 
> codec installed (illuminable oggcodecs),
> Windows Media Player shows the ogg/theora file playing time, before it 
> starts playing the file.
>
> Thanks!
>
> LS
>
>
> _______________________________________________
> Theora-dev mailing list
> Theora-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/theora-dev
>
>
> 




More information about the Theora-dev mailing list