Constructor
new TsTransmuxer(mimeType)
Parameters:
| Name | Type | Description |
|---|---|---|
mimeType |
string |
- Implements:
- Extends:
- Source:
Extends
Members
SUPPORTED_AUDIO_CODECS_ :Array<string>
Supported audio codecs.
Type:
- Array<string>
- Source:
SUPPORTED_VIDEO_CODECS_ :Array<string>
Supported audio codecs.
Type:
- Array<string>
- Source:
av1Info_ :shaka.codec.AV1.Info
The AV1 sequence header only rides in key frames, so cache what it says
and let the inter frames that follow reuse it.
Type:
- Source:
frameIndex :number
Type:
- number
- Overrides:
- Source:
initSegments :Map<string, !Uint8Array>
Type:
- Map<string, !Uint8Array>
- Overrides:
- Source:
lastInitSegment_ :Uint8Array
Type:
- Uint8Array
- Overrides:
- Source:
originalMimeType_ :string
Type:
- string
Methods
convertCodecs(contentType, mimeType) → {string}
For any stream, convert its codecs to MP4 codecs.
Parameters:
| Name | Type | Description |
|---|---|---|
contentType |
string | |
mimeType |
string |
- Implements:
- Source:
Returns:
- Type
- string
destroy()
Destroy
- Overrides:
- Implements:
- Source:
getAacStreamInfo_(tsParser, stream, duration, referencenullable) → {shaka.util.Mp4Generator.StreamInfo}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
tsParser |
shaka.util.TsParser | ||
stream |
shaka.extern.Stream | ||
duration |
number | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Source:
Returns:
getAc3StreamInfo_(tsParser, stream, duration, referencenullable) → {shaka.util.Mp4Generator.StreamInfo}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
tsParser |
shaka.util.TsParser | ||
stream |
shaka.extern.Stream | ||
duration |
number | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Source:
Returns:
getAv1StreamInfo_(tsParser, stream, duration, referencenullable) → {shaka.util.Mp4Generator.StreamInfo}
Builds the StreamInfo for an AV1 stream.
Unlike AVC/HEVC there are no frames to reassemble: a PES carries one, and
only one, AV1 access unit, which is what an `av01` sample holds. All that
the payload needs is to be converted back from the start code based format
MPEG-2 TS wraps it in, and the OBUs are only walked afterwards to find the
sequence header and the frame type.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
tsParser |
shaka.util.TsParser | ||
stream |
shaka.extern.Stream | ||
duration |
number | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Source:
Returns:
getAvcStreamInfo_(tsParser, stream, duration, referencenullable) → {shaka.util.Mp4Generator.StreamInfo}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
tsParser |
shaka.util.TsParser | ||
stream |
shaka.extern.Stream | ||
duration |
number | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Source:
Returns:
getEc3StreamInfo_(tsParser, stream, duration, referencenullable) → {shaka.util.Mp4Generator.StreamInfo}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
tsParser |
shaka.util.TsParser | ||
stream |
shaka.extern.Stream | ||
duration |
number | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Source:
Returns:
getHvcStreamInfo_(tsParser, stream, duration, referencenullable) → {shaka.util.Mp4Generator.StreamInfo}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
tsParser |
shaka.util.TsParser | ||
stream |
shaka.extern.Stream | ||
duration |
number | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Source:
Returns:
getId3Timestamp(id3Datanon-null, defaultTimestamp) → {number}
Reads the transport-stream timestamp carried in the given ID3 data (the
'com.apple.streaming.transportStreamTimestamp' frame), if present, falling
back to the provided default otherwise.
Parameters:
| Name | Type | Description |
|---|---|---|
id3Data |
Uint8Array | |
defaultTimestamp |
number |
- Overrides:
- Source:
Returns:
- Type
- number
getMp3StreamInfo_(tsParser, stream, duration, referencenullable) → {shaka.util.Mp4Generator.StreamInfo}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
tsParser |
shaka.util.TsParser | ||
stream |
shaka.extern.Stream | ||
duration |
number | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Source:
Returns:
getOpusStreamInfo_(tsParser, stream, duration, referencenullable) → {shaka.util.Mp4Generator.StreamInfo}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
tsParser |
shaka.util.TsParser | ||
stream |
shaka.extern.Stream | ||
duration |
number | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Source:
Returns:
getOriginalMimeType() → {string}
- Overrides:
- Implements:
- Source:
Returns:
- Type
- string
isSupported(mimeType, contentTypeopt) → {boolean}
Check if the mime type and the content type is supported.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
mimeType |
string | ||
contentType |
string |
<optional> |
- Implements:
- Source:
Returns:
- Type
- boolean
isTsContainer_(mimeType) → {boolean}
Check if the mimetype is 'video/mp2t' or 'audio/mp2t'.
Parameters:
| Name | Type | Description |
|---|---|---|
mimeType |
string |
- Source:
Returns:
- Type
- boolean
packageSegment(mp4Generatornon-null, stream, referencenullable) → {shaka.extern.TransmuxerOutput}
Packages the init and media segments produced by the given Mp4Generator.
The init segment is cached per discontinuity and the running frame index is
advanced. The init segment is only (re)appended when it differs from the
last one used.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
mp4Generator |
shaka.util.Mp4Generator | ||
stream |
shaka.extern.Stream | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Overrides:
- Source:
Returns:
transmux(data, stream, referencenullable, duration, contentType) → {Promise<(!Uint8Array|!shaka.extern.TransmuxerOutput)>}
Transmux a input data to MP4.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
data |
BufferSource | ||
stream |
shaka.extern.Stream | ||
reference |
shaka.media.SegmentReference |
<nullable> |
The segment reference, or null for init segments |
duration |
number | ||
contentType |
string |
- Implements:
- Source:
Returns:
If you
only want to return the result, use Uint8Array, if you want to separate
the initialization segment and the data segment, you have to use
shaka.extern.TransmuxerOutput
- Type
- Promise<(!Uint8Array|!shaka.extern.TransmuxerOutput)>