mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 10:53:50 +02:00
Add internalCodecId field
This commit is contained in:
@@ -30,6 +30,7 @@ export type PacketStats = {
|
||||
export interface InputTrackBacking {
|
||||
getId(): number;
|
||||
getCodec(): MediaCodec | null;
|
||||
getInternalCodecId(): string | number | Uint8Array | null;
|
||||
getName(): string | null;
|
||||
getLanguageCode(): string;
|
||||
getTimeResolution(): number;
|
||||
@@ -85,6 +86,22 @@ export abstract class InputTrack {
|
||||
return this._backing.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* The identifier of the codec used internally by the container. It is not homogenized by Mediabunny
|
||||
* and depends entirely on the container format.
|
||||
*
|
||||
* This field can be used to determine the codec of a track in case Mediabunny doesn't know that codec.
|
||||
*
|
||||
* - For ISOBMFF files, this field returns the name of the Sample Description Box (e.g. 'avc1').
|
||||
* - For Matroska files, this field returns the value of the CodecID element.
|
||||
* - For WAVE files, this field returns the value of the format tag in the 'fmt ' chunk.
|
||||
* - For ADTS files, this field contains the MPEG-4 Audio Object Type.
|
||||
* - In all other cases, this field is `null`.
|
||||
*/
|
||||
get internalCodecId() {
|
||||
return this._backing.getInternalCodecId();
|
||||
}
|
||||
|
||||
/** The ISO 639-2/T language code for this track. If the language is unknown, this field is 'und' (undetermined). */
|
||||
get languageCode() {
|
||||
return this._backing.getLanguageCode();
|
||||
|
||||
Reference in New Issue
Block a user