W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2012

Re: [whatwg] [mimesniff] Handling container formats like Ogg

From: Ralph Giles <giles@mozilla.com>
Date: Tue, 27 Nov 2012 14:24:57 -0800
Message-ID: <50B53DB9.3070601@mozilla.com>
To: whatwg@lists.whatwg.org
On 12-11-27 9:19 AM, Gordon P. Hemsley wrote:

> Is it sufficient to sniff just for "application/ogg" and then let the
> UA's Ogg library determine whether or not the contents of the file can
> be handled? (I'm sensing the consensus is yes.)

I think so.

Defining a codec enumerating algorithm and mime type decision tree is
going to be several pages of spec for container formats like Ogg and
Matroska.

As an example, the 'file' tool reads the first codec header present in
an Ogg file, which can be found at a set of fixed offsets. This lets it
get some useful information for a lot of files, especially since it's
RECOMMENDED that primary codecs are listed first. I.e. theora should be
first in a 'video/ogg', opus should be first in an 'audio/ogg; codecs=opus'.

But files can be muxed without following the priority rule and will
still play fine, and there can be a 'skeleton' header in front of the
other codec data, obcuring primary role. Just looking at fixed offsets
isn't sufficient to distinguish audio and video reliably.

IMHO,
 -r
Received on Tuesday, 27 November 2012 22:28:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT