Skip to main content

Module decode

Module decode 

Source
Expand description

Decoders for the client camera uplink.

Clients send whatever their browser can produce: H.264 (WebCodecs or the WebRTC media track), VP8/VP9/AV1/HEVC (same sources), or MJPEG from the canvas fallback. Every codec lands in the same I420 view so the rest of the pipeline is codec-agnostic. Inter-coded codecs go through FFmpeg’s avcodec (already linked for VA-API); MJPEG goes through TurboJPEG, which pixelflux already uses for its own JPEG stripes. Decoding is software here; a hardware decoder only changes which Decoder is constructed.

Structs§

AvDecoder
avcodec-backed decoder for the inter-coded codecs.
JpegDecoder
TurboJPEG decoder: 4:2:0 JPEGs decode straight into I420 planes; other subsamplings take the RGB route and are converted.

Enums§

Codec
Input codecs, by wire id. The ids are part of the Selkies WebSocket framing and are exported to Python as VirtualCamera.CODEC_*.
DecodeError

Traits§

Decoder

Functions§

new_decoder
sniff_keyframe
Cheap bitstream inspection for the codecs whose keyframes can be recognized without a full parse; None when the codec gives no such signal and the caller’s flag must be trusted.