1 | # Media Source Extensions Notes
|
2 | A collection of findings experimenting with Media Source Extensions on
|
3 | Chrome 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
|
12 | A working initialization segment is outlined below. It may be possible
|
13 | to 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
|
27 | The structure of a minimal media segment that actually encapsulates
|
28 | movie 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 |
|
40 | sample: time {number}, data {array}
|
41 | chunk: samples {array}
|
42 | track: samples {array}
|
43 | segment: moov {box}, mdats {array} | moof {box}, mdats {array}, data {array}
|
44 |
|
45 | track
|
46 | chunk
|
47 | sample
|
48 |
|
49 | movie fragment -> track fragment -> [samples]
|
50 |
|
51 | ### Sample Data Offsets
|
52 | Movie-fragment Relative Addressing: all trun data offsets are relative
|
53 | to the containing moof (?).
|
54 |
|
55 | Without default-base-is-moof, the base data offset for each trun in
|
56 | trafs after the first is the *end* of the previous traf.
|
57 |
|
58 | #### iso5/DASH Style
|
59 | moof
|
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
|
65 | mdat
|
66 | |- samples_for_trun_0 (100 bytes)
|
67 | |- samples_for_trun_1 (200 bytes)
|
68 | `- samples_for_trun_2
|
69 |
|
70 | #### Single Track Style
|
71 | moof
|
72 | `- traf
|
73 | `- trun_0 <size of moof> + 0
|
74 | mdat
|
75 | `- samples_for_trun_0 |
\ | No newline at end of file |