Skip to main content

OutputFormat

Base class representing an output media file format.

Properties

string
The file extension used by this output format, beginning with a dot.
string
The base MIME type of the output format.
boolean
Whether this output format supports video rotation metadata.
boolean
Whether this output format’s tracks store timestamped media data. When true, the timestamps of added packets will be respected, allowing things like gaps in media data or non-zero start times. When false, the format’s media data implicitly starts at zero and follows an implicit sequential timing from there, using the intrinsic durations of the media data.

Methods

() => MediaCodec[]
Returns a list of media codecs that this output format can contain.
() => TrackCountLimits
Returns the number of tracks that this output format supports.
() => VideoCodec[]
Returns a list of video codecs that this output format can contain.
() => AudioCodec[]
Returns a list of audio codecs that this output format can contain.
() => SubtitleCodec[]
Returns a list of subtitle codecs that this output format can contain.

Types

InclusiveIntegerRange

Specifies an inclusive range of integers.

TrackCountLimits

Specifies the number of tracks (for each track type and in total) that an output format supports.

MP4 and MOV formats

Mp4OutputFormat

MPEG-4 Part 14 (MP4) file format. Supports most codecs.

Constructor

Properties

string
Returns '.mp4'
string
Returns 'video/mp4'
boolean
Returns true
boolean
Returns true

MovOutputFormat

QuickTime File Format (QTFF), often called MOV. Supports all video and audio codecs, but not subtitle codecs.

Constructor

Properties

string
Returns '.mov'
string
Returns 'video/quicktime'
boolean
Returns true
boolean
Returns true

IsobmffOutputFormatOptions

ISOBMFF-specific output options.

Matroska and WebM formats

MkvOutputFormat

Matroska file format. Supports writing transparent video. For a video track to be marked as transparent, the first packet added must contain alpha side data.

Constructor

Properties

string
Returns '.mkv'
string
Returns 'video/x-matroska'
boolean
Returns false (while it technically supports it with ProjectionPoseRoll, many players appear to ignore this value)
boolean
Returns true

WebMOutputFormat

WebM file format, based on Matroska. Supports writing transparent video. For a video track to be marked as transparent, the first packet added must contain alpha side data.

Constructor

Properties

string
Returns '.webm'
string
Returns 'video/webm'
boolean
Returns false
boolean
Returns true

MkvOutputFormatOptions

Matroska-specific output options.

WebMOutputFormatOptions

WebM-specific output options.

Audio formats

Mp3OutputFormat

MP3 file format.

Constructor

Properties

string
Returns '.mp3'
string
Returns 'audio/mpeg'
boolean
Returns false
boolean
Returns false

Mp3OutputFormatOptions

MP3-specific output options.

WavOutputFormat

WAVE file format, based on RIFF.

Constructor

Properties

string
Returns '.wav'
string
Returns 'audio/wav'
boolean
Returns false
boolean
Returns false

WavOutputFormatOptions

WAVE-specific output options.

OggOutputFormat

Ogg file format.

Constructor

Properties

string
Returns '.ogg'
string
Returns 'application/ogg'
boolean
Returns false
boolean
Returns false

OggOutputFormatOptions

Ogg-specific output options.

AdtsOutputFormat

ADTS file format.

Constructor

Properties

string
Returns '.aac'
string
Returns 'audio/aac'
boolean
Returns false
boolean
Returns false

AdtsOutputFormatOptions

ADTS-specific output options.

FlacOutputFormat

FLAC file format.

Constructor

Properties

string
Returns '.flac'
string
Returns 'audio/flac'
boolean
Returns false
boolean
Returns false

FlacOutputFormatOptions

FLAC-specific output options.

Transport Stream formats

MpegTsOutputFormat

MPEG Transport Stream file format.

Constructor

Properties

string
Returns '.ts'
string
Returns 'video/MP2T'
boolean
Returns false
boolean
Returns true

MpegTsOutputFormatOptions

MPEG-TS-specific output options.