UNPKG

1.66 kBMarkdownView Raw
1# Media Source Extensions Notes
2A collection of findings experimenting with Media Source Extensions on
3Chrome 36.
4
5* Specifying an audio and video codec when creating a source buffer
6 but passing in an initialization segment with only a video track
7 results in a decode error
8
9## ISO Base Media File Format (BMFF)
10
11### Init Segment
12A working initialization segment is outlined below. It may be possible
13to trim this structure down further.
14
15- `ftyp`
16- `moov`
17 - `mvhd`
18 - `trak`
19 - `tkhd`
20 - `mdia`
21 - `mdhd`
22 - `hdlr`
23 - `minf`
24 - `mvex`
25
26### Media Segment
27The structure of a minimal media segment that actually encapsulates
28movie data is outlined below:
29
30- `moof`
31 - `mfhd`
32 - `traf`
33 - `tfhd`
34 - `tfdt`
35 - `trun` containing samples
36- `mdat`
37
38### Structure
39
40sample: time {number}, data {array}
41chunk: samples {array}
42track: samples {array}
43segment: moov {box}, mdats {array} | moof {box}, mdats {array}, data {array}
44
45track
46 chunk
47 sample
48
49movie fragment -> track fragment -> [samples]
50
51### Sample Data Offsets
52Movie-fragment Relative Addressing: all trun data offsets are relative
53to the containing moof (?).
54
55Without default-base-is-moof, the base data offset for each trun in
56trafs after the first is the *end* of the previous traf.
57
58#### iso5/DASH Style
59moof
60|- traf (default-base-is-moof)
61| |- trun_0 <size of moof> + 0
62| `- trun_1 <size of moof> + 100
63`- traf (default-base-is-moof)
64 `- trun_2 <size of moof> + 300
65mdat
66|- samples_for_trun_0 (100 bytes)
67|- samples_for_trun_1 (200 bytes)
68`- samples_for_trun_2
69
70#### Single Track Style
71moof
72`- traf
73 `- trun_0 <size of moof> + 0
74mdat
75`- samples_for_trun_0
\No newline at end of file