Constructor
new LocTransmuxer(mimeType)
Parameters:
| Name | Type | Description |
|---|---|---|
mimeType |
string |
- Implements:
- Source:
Members
SUPPORTED_AUDIO_CODECS_ :Array<string>
Supported audio codecs.
Type:
- Array<string>
- Source:
SUPPORTED_VIDEO_CODECS_ :Array<string>
Supported video codecs.
Type:
- Array<string>
- Source:
avcInfo_ :?{videoConfig: !Uint8Array, hSpacing: number, vSpacing: number, height: number, width: number}
Cached result of H264.parseInfo(), populated from the first IDR frame
that carries SPS+PPS. Reused for all subsequent non-IDR frames.
Type:
- ?{videoConfig: !Uint8Array, hSpacing: number, vSpacing: number, height: number, width: number}
- Source:
hvcInfo_ :?{videoConfig: !Uint8Array, hSpacing: number, vSpacing: number, height: number, width: number}
Cached result of H265.parseInfo(), populated from the first IDR frame
that carries VPS+SPS+PPS. Reused for all subsequent non-IDR frames.
Type:
- ?{videoConfig: !Uint8Array, hSpacing: number, vSpacing: number, height: number, width: number}
- Source:
initSegments :Map<string, !Uint8Array>
Type:
- Map<string, !Uint8Array>
- Source:
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
- Implements:
- Source:
extractNalus_(datanon-null, codec) → {Array<shaka.extern.VideoNalu>}
Extracts NAL units from a LOC video payload.
The LOC spec (§2.1) allows two framing formats:
- **Length-prefix** (§2.1.3): 4-byte big-endian length before each NALU.
This is the canonical AVCC/HVCC format.
- **Start-code** (§2.1.4): a 4-byte value of `0x00000001` (= 1 in network
byte order) is reserved as a start-code sentinel; the extractor then
scans ahead for the next 3- or 4-byte start code boundary. Per the
spec a length value of 1 SHOULD be interpreted this way.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Uint8Array | |
codec |
string | Normalised codec string: 'avc' or 'hvc' |
- Source:
Returns:
- Type
- Array<shaka.extern.VideoNalu>
getAacStreamInfo_(datanon-null, stream, duration, referencenullable) → {shaka.util.Mp4Generator.StreamInfo}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
data |
Uint8Array | ||
stream |
shaka.extern.Stream | ||
duration |
number | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Source:
Returns:
getAvcStreamInfo_(datanon-null, stream, referencenullable, duration) → {shaka.util.Mp4Generator.StreamInfo}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
data |
Uint8Array | ||
stream |
shaka.extern.Stream | ||
reference |
shaka.media.SegmentReference |
<nullable> |
|
duration |
number |
- Source:
Returns:
getHvcStreamInfo_(datanon-null, stream, duration, referencenullable) → {shaka.util.Mp4Generator.StreamInfo}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
data |
Uint8Array | ||
stream |
shaka.extern.Stream | ||
duration |
number | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Source:
Returns:
getOpusStreamInfo_(datanon-null, stream, duration, referencenullable) → {shaka.util.Mp4Generator.StreamInfo}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
data |
Uint8Array | ||
stream |
shaka.extern.Stream | ||
duration |
number | ||
reference |
shaka.media.SegmentReference |
<nullable> |
- Source:
Returns:
getOriginalMimeType() → {string}
Returns the original mimetype of the transmuxer.
- Implements:
- Source:
Returns:
- Type
- string
isLocContainer_(mimeType) → {boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
mimeType |
string |
- Source:
Returns:
- Type
- boolean
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
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)>