Interface: shaka.extern.ICeaParser

Methods

init(initSegmentnon-null)

Initializes the parser with init segment data.
Parameters:
Name Type Description
initSegment BufferSource init segment to parse.
Source:

parse(mediaSegmentnon-null) → {Array<!shaka.extern.ICeaParser.CaptionPacket>}

Parses the stream and extracts closed captions packets.
Parameters:
Name Type Description
mediaSegment BufferSource media segment to parse.
Source:
Returns:
Type
Array<!shaka.extern.ICeaParser.CaptionPacket>

Type Definitions

CaptionPacket

Parsed Caption Packet.
Type:
  • {packet: !Uint8Array, pts: number, format: string}
Properties:
Name Type Description
packet Uint8Array The raw caption bytes. Depending on the source, it can be: - A "User data registered by Recommendation ITU-T T.35 SEI message" (sections D.1.6 and D.2.6 of Rec. ITU-T H.264, 06/2019), when `format` is `sei. - Raw CEA-608 byte pairs from a dedicated 'c608' MP4 track sample, when `format` is `raw608`. In this case, the data does **not** include NAL units, length prefixes, or SEI headers.
pts number The presentation timestamp (PTS) of this caption packet in seconds. For SEI-based captions, this corresponds to the PTS of the containing video sample. For raw CEA-608 track samples, it corresponds to the PTS of the 'c608' sample.
format string The origin format of the caption packet: - `sei` for ITU-T T.35 SEI messages embedded in video samples. - `raw608` for raw CEA-608 samples from a dedicated MP4 track.
Source: