TypeScript Types Reference
The following types are part of the stable API of @remotion/media-parser:
MediaParserDimensions
import type {MediaParserDimensions } from '@remotion/media-parser';MediaParserAudioCodec
import type {MediaParserAudioCodec } from '@remotion/media-parser';More values may be added in the future, this would not be considered a breaking change.
MediaParserVideoCodec
import type {MediaParserVideoCodec } from '@remotion/media-parser';More values may be added in the future, this would not be considered a breaking change.
MediaParserContainer
import type {MediaParserContainer } from '@remotion/media-parser';More values may be added in the future, this would not be considered a breaking change.
MediaParserLocation
import type {MediaParserLocation } from '@remotion/media-parser';MediaParserEmbeddedImage
import type {MediaParserEmbeddedImage } from '@remotion/media-parser';mimeType: The MIME type of the image, ornulldescription: A description of the image, ornulldata: The image data as aUint8Array
MediaParserKeyframe
import type {MediaParserKeyframe } from '@remotion/media-parser';presentationTimeInSeconds: The time in seconds when the keyframe should be presenteddecodingTimeInSeconds: The time in seconds when the keyframe should be decodedpositionInBytes: The position in bytes where the keyframe is located in the filesizeInBytes: The size of the keyframe in bytestrackId: The ID of the track the frame belongs to
MediaParserLogLevel
import type {MediaParserLogLevel } from '@remotion/media-parser';MediaParserMetadataEntry
import type {MediaParserMetadataEntry } from '@remotion/media-parser';MediaParserAudioSample
import type {MediaParserAudioSample } from '@remotion/media-parser';MediaParserOnAudioSample
import type {MediaParserOnAudioSample } from '@remotion/media-parser';The data, timestamp, duration, type fields are in a format so that this type can be passed into the EncodedAudioChunk constructor.
The other fields are for informative purposes.
MediaParserVideoSample
import type {MediaParserVideoSample } from '@remotion/media-parser';Note: timestamp is the presentation timestamp of the sample. decodingTimestamp is the timestamp of the sample when it will be decoded.
The data, timestamp, duration, type fields are in a format so that this type can be passed into the EncodedVideoChunk constructor.
The other fields are for informative purposes.
MediaParserOnVideoSample
import type {MediaParserOnVideoSample } from '@remotion/media-parser';MediaParserAudioTrack
import type {MediaParserAudioTrack } from '@remotion/media-parser';MediaParserOnAudioTrackParams
import type {MediaParserOnAudioTrackParams } from '@remotion/media-parser';MediaParserOnVideoTrackParams
import type {MediaParserOnVideoTrackParams } from '@remotion/media-parser';MediaParserAdvancedColor
import type {MediaParserAdvancedColor } from '@remotion/media-parser';MediaParserMatrixCoefficients
import type {MediaParserMatrixCoefficients } from '@remotion/media-parser';More values may be added in the future, this would not be considered a breaking change.
MediaParserPrimaries
import type {MediaParserPrimaries } from '@remotion/media-parser';More values may be added in the future, this would not be considered a breaking change.
MediaParserTransferCharacteristics
import type {MediaParserTransferCharacteristics } from '@remotion/media-parser';More values may be added in the future, this would not be considered a breaking change.
MediaParserVideoTrack
import {MediaParserVideoCodec , MediaParserCodecData , MediaParserSampleAspectRatio , MediaParserAdvancedColor } from '@remotion/media-parser';
export type MediaParserVideoTrack = {
// WebCodecs
codec : string;
description : Uint8Array | undefined;
colorSpace : VideoColorSpaceInit ;
codedWidth : number;
codedHeight : number;
displayAspectWidth : number;
displayAspectHeight : number;
// Non-WebCodecs
type : 'video';
trackId : number;
codecEnum : MediaParserVideoCodec ;
codecData : MediaParserCodecData | null;
sampleAspectRatio : MediaParserSampleAspectRatio ;
width : number;
height : number;
rotation : number;
fps : number | null;
timescale : number;
advancedColor : MediaParserAdvancedColor ;
m3uStreamFormat : 'ts' | 'mp4' | null;
// When the track starts in seconds - can be non-zero for MP4 containers.
// You don't need to account for it, as the samples will already be offset by this amount.
startInSeconds : number;
};See: VideoColorSpaceInit WebCodecs definition
MediaParserAudioTrack
import type {MediaParserAudioTrack } from '@remotion/media-parser';MediaParserOtherTrack
import type {MediaParserOtherTrack } from '@remotion/media-parser';MediaParserTrack
import type {MediaParserTrack } from '@remotion/media-parser';MediaParserSampleAspectRatio
import type {MediaParserSampleAspectRatio } from '@remotion/media-parser';MediaParserOnVideoTrack
import type {MediaParserOnVideoTrack } from '@remotion/media-parser';MediaParserOnAudioTrack
import type {MediaParserOnAudioTrack } from '@remotion/media-parser';MediaParserOnVideoTrackParams
import type {MediaParserOnVideoTrackParams } from '@remotion/media-parser';MediaParserOnAudioTrackParams
import type {MediaParserOnAudioTrackParams } from '@remotion/media-parser';ParseMediaSrc
import type {ParseMediaSrc } from '@remotion/media-parser';M3uStream
import type {M3uStream } from '@remotion/media-parser';bandwidthInBitsPerSec: The bandwidth of the stream. May benull.averageBandwidthInBitsPerSec: The average bandwidth of the stream. May benull.resolution: The resolution of the stream. May benull.codecs: The codec strings of the stream as an array May benull.src: The URL or file path of the streamid: A unique identifier that Remotion gives the streamassociatedPlaylists: An array ofM3uAssociatedPlaylist- other (probably audio) tracks that are connected to this stream but live in a separate file.
M3uAssociatedPlaylist
import type {M3uAssociatedPlaylist } from '@remotion/media-parser';src: The URL or file path of the audio trackautoselect: Corresponds to theAUTOSELECTattribute in the HLS playlistdefault: Corresponds to theDEFAULTattribute in the HLS playlistlanguage: The language of the audio trackname: The name of the audio trackgroupId: The group ID of the audio trackchannels: The number of audio channels in the audio track, ornull.
SeekResolutionv4.0.312
import type {SeekResolution } from '@remotion/media-parser';