Re(2): [vorbis-dev] Mime Type and Ogg

Ali Abdin aliabdin at aucegypt.edu
Sat Oct 14 17:55:42 PDT 2000



* Ralph Giles (giles at snow.ashlu.bc.ca) wrote at 22:41 on 14/10/00:
> On Sat, 14 Oct 2000, Ali Abdin wrote:
> 
> > Okay - this is a problem. You see, stating that "foo.ogg" is an
> > application/x-ogg is incorrect because it is not an application.
> 
> As patrick mentioned, this is an old flamewar. At least you're complaining
> about mime stuff rather than file extensions. :)

Yeah - I don't care about file extensions :P
 
> We use 'application' because it seems to be the only catch-all for general
> multimedia content in a complex format. Same way PDF is application/x-pdf.

For ogg to do this is 'misleading' and will cause headaches for application
(i.e. ogg123 can only handle audio, and not video). Sure, we could use
libvorbis or whatever to figure things out but that:
A) Introduced a dependency on libvorbis (i.e. not everyone has it installed or
wants to have it installed)
and
B) We couldn't check based on mime "magic" stuff.

> > What Nautilus does is check the mime super-type and if it is 'audio' then it
> > will do some special music handling functions (i.e. Sound Preview, 'View as
> > Music', etc.) This is no problem with mp3 as it is audio/x-mp3 or audio/mpeg
> > or whatever.
> > 
> > Now in Nautilus we want to support audio files (i.e. it doesn't make sense to
> > try and play a video codec using 'ogg123'). Is this possible at all?
> > 
> > For the mime magic detection stuff we check for the "OggS" at the beginning,
> > and for the extension we check for '.ogg'
> 
> You could easily extend the magic check to look for a vorbis substream. In
> the 1.0 mapping the file should always have 'vorbis' starting at byte
> 28+(the value of byte 26). In fact, I suspect byte 26 will always be 1.

Okay - I am not sure I can get the 'value' of byte 26 in the simple mime-magic
description file - so i may have to assume it is just '1'. This is the line I
currently use:
0       string          OggS                                    audio/x-ogg

the first field is offset, the second is type, the third is the thing we are
looking for, and the last is the mime-type.
 
> This assumes the first logical bitstream header is the vorbis one, which
> is of course true of audio-only files. I suspect it will also be true in
> general, to coddle broken player implementations that don't expect other
> streams.
> 
> Of course, none of this helps keying your database off 'audio' (which
> seems wrong anyway) or using a different ogg player for audio vs. a/v
> files. I wouldn't worry about it beyond associating ogg123 with
> application/x-ogg with .ogg/OggS. If ogg123 (or whatever) turns out not to
> be up to playing both types, it can be replaced by a smart launcher that
> does content examination.

No - the whole concept of mime-type is for an application to be able to
"handle" only the files that it knows about. It seems the situation here is I
handle all of "Ogg" (i.e. a/v) or nothing at all. I would like to handle just
the audio part of ogg (i.e. vorbis) - and there seems to be absolutely no way
to do this.

Even if I check byte offset 29 for 'vorbis' - as far as I understand this
means it could be a video stream with vorbis audio embedded in it. So
basically checking for it only tells me "this file has audio in it" instead of
"this file is audio-only"

> The problem with having both audio/ogg and video/ogg (and text/ogg) is
> that webservers would have to do the complicated content examination 
> I described above to set it properly. Arguably they should be allowed the
> easier time...and it's much easier to get Ogg support added to a media
> player than a web server.

There should be a way to have a 'generic' ogg support (i.e. check for OggS at
offset '0') and a way to get more "specific" information (is this an "audio"
or "audio/visual" format). This can be done by checking a different offset.

I do not think it is right to force "media players" to hack around this
limitation, when you can support both ways.

I am CCing mjs, an Eazel hacker who probably knows much more about this than I
do. He knows much more than me about mime-type stuff (I basically know nothing
about it) 

Regards,
Ali

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list