HlsOutputFormat
HTTP Live Streaming (HLS) output format. HLS media is represented by a set of .m3u8 playlist files and media segment files, meaning this format writes out multiple files, requiring the use of a pathed Output (OutputOptions.target must be a PathedTarget).
This output format creates the following files:
- A master playlist .m3u8 file, containing the list of available playlists. A master playlist is always emitted, written to the root path.
- One .m3u8 file for each playlist, each containing a list of media segments.
- Many media segments, containing the actual media data.
To emit media playlists that use the #EXT-X-PROGRAM-DATE-TIME tag to map segment timestamps to real-world time, set BaseTrackMetadata.isRelativeToUnixEpoch to true for all tracks.
Extends: OutputFormat
Constructor
constructor(
options: HlsOutputFormatOptions,
): HlsOutputFormat;Creates a new HlsOutputFormat configured with the specified options.
Properties
fileExtension
get fileExtension(): string;The file extension used by this output format, beginning with a dot.
mimeType
get mimeType(): string;The base MIME type of the output format.
supportsTimestampedMediaData
get supportsTimestampedMediaData(): 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.
supportsVideoRotationMetadata
get supportsVideoRotationMetadata(): boolean;Whether this output format supports video rotation metadata.
Methods
getSupportedAudioCodecs()
getSupportedAudioCodecs(): "aac" | "opus" | "mp3" | "vorbis" | "flac" | "ac3" | "eac3" | "pcm-s16" | "pcm-s16be" | "pcm-s24" | "pcm-s24be" | "pcm-s32" | "pcm-s32be" | "pcm-f32" | "pcm-f32be" | "pcm-f64" | ... 4 more ... | "alaw"[];Returns a list of audio codecs that this output format can contain.
getSupportedCodecs()
getSupportedCodecs(): MediaCodec[];Returns a list of media codecs that this output format can contain.
See MediaCodec.
getSupportedSubtitleCodecs()
getSupportedSubtitleCodecs(): "webvtt"[];Returns a list of subtitle codecs that this output format can contain.
getSupportedTrackCounts()
getSupportedTrackCounts(): TrackCountLimits;Returns the number of tracks that this output format supports.
See TrackCountLimits.
getSupportedVideoCodecs()
getSupportedVideoCodecs(): "avc" | "hevc" | "vp9" | "av1" | "vp8"[];Returns a list of video codecs that this output format can contain.