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:
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:
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'.
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)>