[whatwg] [mimesniff] Handling container formats like Ogg

Silvia Pfeiffer silviapfeiffer1 at gmail.com
Tue Nov 27 00:40:02 PST 2012


For Ogg, if you rely on the Ogg files having a Skeleton track [1], it's not
actually difficult at all, since the mime type of the codecs used in the
tracks that Skeleton is describing are explicitly included in Skeleton.

Then all you have to do is check which codec mime types are present to make
to file mime types: http://wiki.xiph.org/MIME_Types_and_File_Extensions ,
e.g. if you find audio/* and video/*, then you have a file mime type of
video/ogg .

HTH.

Cheers,
Silvia.

[1] http://wiki.xiph.org/Ogg_Skeleton_4

On Tue, Nov 27, 2012 at 10:45 AM, Adam Barth <w3c at adambarth.com> wrote:

> I included H.264 sniffing in the spec because some implementors
> specifically asked for it (and it wasn't all that complicated).  For
> Ogg, I'd wait until implementors ask you to include it.
>
> Adam
>
>
> On Mon, Nov 26, 2012 at 2:59 PM, Gordon P. Hemsley <gphemsley at gmail.com>
> wrote:
> > Container formats like Ogg can be used to store many different audio
> > and video formats, all of which can be identified generically as
> > "application/ogg". Determining which individual format to use (which
> > can be identified interchangeably as the slightly-less-generic
> > "audio/ogg" or "video/ogg", or using a 'codecs' parameter, or using a
> > dedicated media type) is much more complex, because they all use the
> > same "OggS" signature. It would requiring actually attempting to parse
> > the Ogg container to determine which audio or video format it is using
> > (perhaps not unsimilar to what is done for MP4 video and what might
> > have to be done with MP3 files without ID3 tags).
> >
> > Would this be something UAs would prefer to handle in their Ogg
> > library, or should I spec it as part of sniffing?
> >
> > --
> > Gordon P. Hemsley
> > me at gphemsley.org
> > http://gphemsley.org/http://gphemsley.org/blog/
>



More information about the whatwg mailing list