Files
VoelinClient/tools
selikhovandClaude Opus 5.5 2d4d28b64d Fall back to the next decoder at runtime; recover from losses
A watched stream now decodes with the best decoder of its codec and,
when it fails, with the next of the codec's ladder, without ending the
watch: three failures in a row (errors, or ten frames without a picture)
replace it, the keyframe that failed starts the next one at once, and
otherwise a keyframe is asked for. Each switch is logged with its reason,
and DecodeStats tells the decoder in use.

The official client's H.264 has B-frames and rare keyframes, and the
pipeline dropped every frame after a loss or an error until the next
keyframe, which such an encoder seldom sends. Decoders that conceal what
a loss leaves missing (FFmpeg's H.264 and HEVC) now go on decoding while
a keyframe is asked for; the others still skip to it. Whenever one is
wanted it is asked for again every half second until it comes, also
while no frame arrives, instead of once per skipped frame.

Pictures come from a small pool and go to the callback as
Arc<VideoFrame>: decoders write into a free one (decode_into), and a
consumer that converts and drops each picture, as the app does, costs no
allocations.

Settings stream.hardware_decoding and stream.decoder_backend choose the
decoders like the encoder settings (decoder_preference); the app applies
them when they change, to streams watched from then on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 23:02:48 +03:00
..