TypeScript 类型参考
@remotion/media-parser 的以下类型是稳定 API 的一部分:
🌐 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:图片的 MIME 类型,或nulldescription:图片的描述,或nulldata:作为Uint8Array的图片数据
MediaParserKeyframe
import type {MediaParserKeyframe } from '@remotion/media-parser';presentationTimeInSeconds:关键帧应该呈现的时间(以秒为单位)decodingTimeInSeconds:关键帧应该解码的时间(以秒为单位)positionInBytes:关键帧在文件中的字节位置sizeInBytes:关键帧的字节大小trackId:该帧所属轨迹的ID
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';data、timestamp、duration、type 字段的格式是这样的,以便这种类型可以传递给 EncodedAudioChunk 构造函数。
🌐 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';注意:timestamp 是样本的显示时间戳。decodingTimestamp 是样本将被解码时的时间戳。
🌐 Note: timestamp is the presentation timestamp of the sample. decodingTimestamp is the timestamp of the sample when it will be decoded.
data、timestamp、duration、type 字段的格式是这样的,以便这种类型可以传递给 EncodedVideoChunk 构造函数。
🌐 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;
};参见:VideoColorSpaceInit WebCodecs 定义
🌐 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:流的带宽。可能是null。averageBandwidthInBitsPerSec:流的平均带宽。可能是null。resolution:流的分辨率。可能是null。codecs:流的编解码器字符串作为数组可能是null。src:流的 URL 或文件路径id:Remotion 给流分配的唯一标识符associatedPlaylists:一个M3uAssociatedPlaylist的数组——其他(可能是音频)轨道,它们与此流相关联,但存储在单独的文件中。
M3uAssociatedPlaylist
import type {M3uAssociatedPlaylist } from '@remotion/media-parser';src:音频轨道的 URL 或文件路径autoselect:对应 HLS 播放列表中的AUTOSELECT属性default:对应 HLS 播放列表中的DEFAULT属性language:音轨的语言name:音轨的名称groupId:音轨的组IDchannels:音轨中的音频通道数量,或null。
SeekResolutionv4.0.312
import type {SeekResolution } from '@remotion/media-parser';