[whatwg] Video with MIME type application/octet-stream

On Sun, 05 Sep 2010 21:59:09 +0200, Aryeh Gregor  
<Simetrical+w3c at gmail.com> wrote:

> On Fri, Sep 3, 2010 at 11:48 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:
>>
>> Is this a reasonable supposition?  What are these byte sequences for the
>> container formats at hand?  (Say WebM's restricted Matroska container,
>> whatever container format is supported for H.264 by IE and Chrome, and  
>> Ogg;
>> we'll ignore the generic Matroska weirdness for now.)
>
> I don't know, which is why I'm considering a hypothetical.  If someone
> who knows better could step up with this piece of info, that would be
> helpful.

The Ogg page begins with the 4 bytes "OggS", which is what Opera  
(GStreamer) checks for. For additional safety, one could also check for  
the trailing version indicator, which ought to be a NULL byte for current  
Ogg. [1] [2]

For WebM, the first 4 bytes are the EBML header: the bytes 0x1A, 0x45,  
0xDF, 0xA3. [3] The EBML DocType in the header must be "webm". Since  
parsing the EBML header is a little bit complicated, Opera (GStreamer)  
simply checks for the string "webm" somewhere in the header. I've heard  
rumors that WebM files are allowed to contain arbitrary garbage before the  
EBML header, but this is something we happily ignore, i.e., such files  
would fail to play in Opera, regardless of MIME type. I haven't  
encountered any such files yet, and think that browsers should not support  
this "feature".

[1] http://www.xiph.org/ogg/doc/framing.html#page_header
[2] http://www.xiph.org/ogg/doc/rfc3533.txt
[3] http://ebml.sourceforge.net/specs/

-- 
Philip J?genstedt
Core Developer
Opera Software

Received on Monday, 6 September 2010 01:14:32 UTC