PrismCore / API reference / Probing and input

Enumeration

SourceOpenTuning

enum SourceOpenTuning

Declared in Sources/PrismCore/Probe/SourceOpenTuning.swift · PrismCore 3.5.4

How much of a source libavformat may read before it has to answer what is in it — the setting that decides what "opening a file" costs over a network.

FFmpeg's defaults (5 MB probe, 5 s of analysis) are tuned for containers that hide their structure. The ones PrismCore takes describe themselves in their header: Matroska carries CodecPrivate, MP4 carries the whole moov. Measured against a 5.4 GB HEVC/EAC3 remux over HTTP, one open cost 1.31 MB across 3 requests at the defaults and 0.92 MB capped — and on a living-room Wi-Fi link to a media server that difference is the visible part of "Preparing…", paid twice because the routing probe and the remuxer each open the source.

The caps are a ceiling, not a target: libavformat stops as soon as it has what it needs, so a well-formed file reads far less than either number. What they bound is the pathological case — sparse audio, junk streams, a container that never settles — where the analysis would otherwise read megabytes to learn nothing new.

Type properties

static let probeSizeBytes: Int

Bytes libavformat may read while probing the container. Comfortably past a Matroska header with dozens of tracks, well short of the default.

static let analyzeDurationMicroseconds: Int

Microseconds of content the analysis may consume. Two seconds covers audio sparse enough to matter (a 1 s cap loses nothing on this corpus, but a stream with a long silent lead-in is exactly the case not worth being clever about).

static let probeBudget: Duration

How long a probe may spend before it answers with an error instead.

A probe with no deadline is a playback with no fallback: a server that accepts the connection and then starves the reads (busy transcoding, sleeping disk) left the host with neither a verdict nor an error — the 2026-08-14 field log shows five play attempts over four minutes with no line from the engine at all, because avformat_open_input was still blocked on the first. Generous on purpose: a healthy probe over LAN answers in well under a second, so the budget only ever cuts off sources that were not going to answer.

Generated from the public symbols of PrismCore 3.5.4. All types