Constructor
new Mp4CeaParser()
- Implements:
- Source:
Members
BitstreamFormat :number
Type:
- number
Properties:
Name | Value | Type | Description |
---|---|---|---|
UNKNOWN |
0 | number | |
H264 |
1 | number | |
H265 |
2 | number |
- Source:
defaultSampleDuration_ :number
Default sample duration, as specified by the TREX box.
Type:
- number
- Source:
defaultSampleSize_ :number
Default sample size, as specified by the TREX box.
Type:
- number
- Source:
trackIdToTimescale_ :Map.<number, number>
Map of track id to corresponding timescale.
Type:
- Map.<number, number>
- Source:
Methods
init(initSegmentnon-null)
Parses the init segment. Gets Default Sample Duration and Size from the
TREX box, and constructs a map of Track IDs to timescales. Each TRAK box
contains a track header (TKHD) containing track ID, and a media header box
(MDHD) containing the timescale for the track
Parameters:
Name | Type | Description |
---|---|---|
initSegment |
BufferSource | init segment to parse. |
- Implements:
- Source:
parse(mediaSegmentnon-null) → {Array.<!shaka.cea.ICeaParser.CaptionPacket>}
Parses each video segment. In fragmented MP4s, MOOF and MDAT come in
pairs. The following logic gets the necessary info from MOOFs to parse
MDATs (base media decode time, sample sizes/offsets/durations, etc),
and then parses the MDAT boxes for CEA-708 packets using this information.
CEA-708 packets are returned in the callback.
Parameters:
Name | Type | Description |
---|---|---|
mediaSegment |
BufferSource | media segment to parse. |
- Implements:
- Source:
Returns:
- Type
- Array.<!shaka.cea.ICeaParser.CaptionPacket>
parseMdat_(readernon-null, time, timescale, defaultSampleDuration, defaultSampleSize, offset, sampleDatanon-null, captionPacketsnon-null)
Parse MDAT box.
Parameters:
Name | Type | Description |
---|---|---|
reader |
shaka.util.DataViewReader | |
time |
number | |
timescale |
number | |
defaultSampleDuration |
number | |
defaultSampleSize |
number | |
offset |
number | |
sampleData |
Array.<shaka.util.ParsedTRUNSample> | |
captionPackets |
Array.<!shaka.cea.ICeaParser.CaptionPacket> |
- Source: