[theora-dev] Differentiating Video from Audio

Conrad Parker conrad at metadecks.org
Sat May 26 21:48:13 PDT 2007

On 26/05/07, Erlend Davidson <E.R.M.Davidson at sms.ed.ac.uk> wrote:
> I am trying to write a "thumbnailer" for the thunar file manager that
> can process .ogg files containing a video stream and produce a thumbnail
> of a particular frame.  The only trouble is telling which files have a
> video stream in an efficient method.  The best I've come up with is
> running ogginfo on every file with the mimetype application/ogg.
> Is there a better method?

In general, you would need to read the headers of the various tracks
to see if a video track exists.

For the normal Ogg Theora mapping, the Theora video track must come
first. In that case, the start of the file will look something like

conrad at growl:/tmp$ xxd dbf.ogg
0000000: 4f67 6753 0002 0000 0000 0000 0000 42cb  OggS..........B.
0000010: 4045 0000 0000 d12e e525 012a 8074 6865  @E.......%.*.the
0000020: 6f72 6103 0200 0018 0012 0001 8000 0120  ora............
0000030: 0000 0000 61c1 0000 03e9 0000 0100 0001  ....a...........
0000040: 0200 0000 80c0 4f67 6753 0002 0000 0000  ......OggS......

So, you could look for the word "theora" in that specific location.

> I know it has been brought up before on this list and others, but is
> there any possibility of separate mimetypes for audio and video ogg files?

Yes, we have recently been having useful discussions about this and
drafted the following reccommendation:




More information about the theora-dev mailing list