You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let callers bound the demux probe budget (probesize / analyze duration) per load #68
Allow a caller to set the open-time probe limits per load(), instead of always using the fixed internal DemuxerOpenProfile.playback (50 MB / 60 s). Two optional LoadOptions fields, both defaulting to today's values so nothing changes unless set:
• probesize: Int64? — maps to AVFormatContext.probesize
• maxAnalyzeDuration: Int64? — maps to AVFormatContext.max_analyze_duration (µs)
Motivating media or use case
A Jellyfin client streaming large remote remuxes from a remote CDN over HTTPS. Example: ~45 GB MKV, HEVC Main 10 4K HDR, multiple AC3 + TrueHD tracks, SubRip + HDMV PGS subtitles, and an mjpeg cover attachment. The sparse PGS and mjpeg streams never resolve codec params, so find_stream_info reads to the full 50 MB budget on every open — ~13–14 s before first frame over the network. Video + audio resolve almost immediately; the rest is spent on streams playback doesn't need. The budget is tuned for local disk (where reading 50 MB is free) and there's currently no way for a remote caller to cap it.
Area
Codec / container support
Host app / integration context
Custom integration — a Multi-Server (Jellyfin, Plex, etc.) client that direct-plays remote CDN-served files through the engine.
For your remote-remux case (the layout is already known from the server's MediaInfo, so a full probe is wasted):
tryawaitengine.load(url:remoteURL,options:LoadOptions(httpHeaders:authHeaders,probesize:4*1024*1024, // 4 MB instead of 50 MB
maxAnalyzeDuration:5*1_000_000 // 5 s instead of 60 s
))
The cap lands on every main-playback open that runs find_stream_info (the routing probe that becomes the session demuxer, the software/audio fallback opens, the audio/title-switch reopens so a switch does not re-pay the cost, and the native HLS fallback open and live reopen). It is deliberately left at the full 50 MB / 60 s on paths where a complete probe is load-bearing: the subtitle side-demuxer (sparse PGS/DVB detection), the probe(url:) metadata API, the Dolby Vision probe, and still extraction.
Two things worth knowing, both documented on the fields:
An over-tight budget fails open, not closed. find_stream_info still returns success with a logged warning, so a late-resolving track goes silently missing rather than erroring. Worth a track-count sanity check after load if you push the budget hard.
maxAnalyzeDuration: 0 is not "no cap": FFmpeg maps 0 to a container-dependent heuristic (~5-7 s for MPEG-TS, longer elsewhere) that is shorter than the 60 s default. Use a positive value for an explicit cap.
Leaving this open until you can confirm the first-frame win on your 45 GB remux over the real CDN. Thanks for the precise report, the sparse-PGS/mjpeg detail made the scope easy to get right.
Appreciate the thorough validation, and good to have it closed. ~2 s open / ~3.7 s first frame down from ~13-14 s is exactly the win this was for, and confirming fail-open enumerated all six streams (the PGS codec params resolving lazily on first packet, as expected) is the reassuring part. Feeding the track index from server MediaInfo to skip the probe(url:) pre-probe entirely is the right call client-side, since that path keeps the full budget by design. Thanks again for the precise reports across #68, #69, and #71.
Activity
feat(demux): let callers bound the open-time probe budget per load (#68)
chore(release): prep 4.2.0 — caller-bounded probe budget (#68)
superuser404notfound commentedon Jun 26, 2026
Shipped in 4.2.0.
LoadOptionsnow carries two optional probe-budget knobs, both defaulting tonilso nothing changes unless you set them:For your remote-remux case (the layout is already known from the server's MediaInfo, so a full probe is wasted):
The cap lands on every main-playback open that runs
find_stream_info(the routing probe that becomes the session demuxer, the software/audio fallback opens, the audio/title-switch reopens so a switch does not re-pay the cost, and the native HLS fallback open and live reopen). It is deliberately left at the full 50 MB / 60 s on paths where a complete probe is load-bearing: the subtitle side-demuxer (sparse PGS/DVB detection), theprobe(url:)metadata API, the Dolby Vision probe, and still extraction.Two things worth knowing, both documented on the fields:
find_stream_infostill returns success with a logged warning, so a late-resolving track goes silently missing rather than erroring. Worth a track-count sanity check after load if you push the budget hard.maxAnalyzeDuration: 0is not "no cap": FFmpeg maps0to a container-dependent heuristic (~5-7 s for MPEG-TS, longer elsewhere) that is shorter than the 60 s default. Use a positive value for an explicit cap.Leaving this open until you can confirm the first-frame win on your 45 GB remux over the real CDN. Thanks for the precise report, the sparse-PGS/mjpeg detail made the scope easy to get right.
superuser404notfound commentedon Jun 26, 2026
Appreciate the thorough validation, and good to have it closed. ~2 s open / ~3.7 s first frame down from ~13-14 s is exactly the win this was for, and confirming fail-open enumerated all six streams (the PGS codec params resolving lazily on first packet, as expected) is the reassuring part. Feeding the track index from server MediaInfo to skip the
probe(url:)pre-probe entirely is the right call client-side, since that path keeps the full budget by design. Thanks again for the precise reports across #68, #69, and #71.fix(subtitles): bound the embedded subtitle side-demuxer open on remo…