DemuxOptions

data class DemuxOptions(val probeSizeBytes: Long? = null, val analyzeDurationMicros: Long? = null, val fpsProbeFrames: Int? = null, val flags: Set<DemuxFlag> = emptySet(), val formatWhitelist: Set<String> = emptySet(), val protocolWhitelist: Set<String> = emptySet(), val ioTimeoutMicros: Long? = null, val options: Map<String, String> = emptyMap(), val format: String? = null)

Typed demuxer options for MediaSource.open, applied between allocation and open, the only moment probe sizes, flags and whitelists can act. compile is the pure mapping to FFmpeg's own option pairs. A key FFmpeg does not consume comes back through MediaSource.unusedOpenOptions instead of being dropped.

val source = MediaSource.open(url, DemuxOptions(probeSizeBytes = 1_000_000, ioTimeoutMicros = 10_000_000))

Two keys are refused on every route, typed or raw, with FFmpegError.InvalidArgument: usetoc, and an fflags value that names fastseek. MP3 seeking is correct only when both are left alone, and either one breaks seeking in a way that looks like a player bug.

Constructors

Link copied to clipboard
constructor(probeSizeBytes: Long? = null, analyzeDurationMicros: Long? = null, fpsProbeFrames: Int? = null, flags: Set<DemuxFlag> = emptySet(), formatWhitelist: Set<String> = emptySet(), protocolWhitelist: Set<String> = emptySet(), ioTimeoutMicros: Long? = null, options: Map<String, String> = emptyMap(), format: String? = null)

Types

Link copied to clipboard
object Companion

Ready-made option sets.

Properties

Link copied to clipboard

How much media the stream analysis may read, in microseconds (analyzeduration).

Link copied to clipboard

Demuxer behaviour flags, added to FFmpeg's defaults rather than replacing them (fflags).

Link copied to clipboard

The demuxer to use, by FFmpeg name, as the command line's -f: the open does not probe. This is what opens headerless input, such as s16le or rawvideo, whose parameters then go in options (sample_rate, video_size and the like). A name this build does not carry fails with FFmpegError.DemuxerNotFound. Unlike formatWhitelist, which only refuses a probed format, this chooses one.

Link copied to clipboard

The only demuxers the open may use, by FFmpeg name (format_whitelist); empty allows all.

Link copied to clipboard

Frames read to measure a stream's frame rate (fpsprobesize).

Link copied to clipboard

How long one network read or write may wait, in microseconds (rw_timeout); null waits for ever.

Link copied to clipboard

Raw option pairs for anything the typed set lacks. They come after the typed ones and win a tie.

Link copied to clipboard

Bytes the demuxer may read to find the streams (probesize; FFmpeg reads 5 000 000).

Link copied to clipboard

The only protocols the open and every nested open may use (protocol_whitelist), such as file or http,tcp; empty allows all. A playlist that points at another protocol is refused.

Functions

Link copied to clipboard

The exact option pairs, in a stable order: typed knobs first, the raw pairs after.