Expand description
Codec identities, wire framing, quantizer domains, level ladders, bitstream reads. What every encoder backend shares about a codec: its name and wire identity, the quantizer domain the session-wide quality index maps onto, the level a stream of a given geometry advertises, and the bitstream reads that label a frame on the wire.
Enums§
- Codec
- The picture codec of a capture session, and of a virtual-camera uplink.
Jpegis the striped still-image mode; the rest are video codecs, which stream as whole frames except H.264, whose software path may also stripe. The discriminants are the codec ids the Python API speaks (VirtualCamera.CODEC_*) and the video wire ids. - Hardware
- The hardware encoder family a session’s quantizer curve is read for
(
Codec::hardware_quantizer).
Constants§
- FRAME_
ANCHOR - A bit ORed into a delta frame’s kind: the session keeps the frame as a long-term reference and
it predicts from one every client holds (
ReferenceWindow::settle), so every client can decode it. - FRAME_
DELTA - FRAME_
INTRA - FRAME_
KEY - Frame kinds in the low nibble of the video type byte: a decode entry point, an intra-coded picture that is not one, and a predicted picture.
- JPEG_
HEADER_ LEN - Bytes of the two stripe headers.
- VIDEO_
HEADER_ LEN - VP8_
LEVEL_ QINDEX - VP8 quantizer index of each libvpx VP8 quantizer level 0..=63.
- VPX_
QINDEX base_q_idxof each libvpx / libaom quantizer level 0..=63, as those libraries map their--min-q/--max-q/--cq-levelarguments.- WIRE_
JPEG - Wire tag of a JPEG stripe:
u8 reserved,u16 frame id,u16 stripe Y, JPEG data. - WIRE_
VIDEO - Wire tag of an encoded video frame or stripe: a type byte whose low nibble is the
frame kind and whose high nibble is the codec’s
Codec::wire_id, thenu16 frame id,u16 stripe Y,u16 width,u16 height,u16 reference(the frame it predicts from, its own id where it names none), and the codec’s own bitstream.
Functions§
- av1_
is_ key - Whether an AV1 temporal unit opens with a key frame: the first frame header or frame
OBU’s
frame_type, read past any temporal delimiter and sequence header. A show existing frame, or a unit without a frame, is a delta. - av1_
level - Lowest AV1 level whose Annex A limits admit a
widthxheightstream atfpscarrying up tobitrate_bps(0 where no rate is declared), as seq_level_idx (8 = 4.0, 13 = 5.1, 19 = 6.3). - frame_
type_ from_ key - The frame kind of a key/delta answer an encoder reports without a bitstream parse.
- h264_
dpb_ frames - The decoded picture buffer, in frames, an H.264 stream at
levelmay declare for awidthxheightpicture: the level’s MaxDpbMbs over the picture’s macroblocks, at mostREFERENCE_FRAMES. - h264_
frame_ type - Wire frame kind of one encoded H.264 access unit, read from the bitstream itself: IDR = key, intra-only non-IDR = intra, predicted = delta. The stripe header labels real decode entry points, so the NAL and slice types the encoder actually produced decide, never what was requested of it. An access unit whose slices cannot be parsed is labeled delta: a false delta costs one skipped entry point, a false key breaks the decoder.
- h264_
level - Lowest H.264 level whose Annex-A Table A-1 limits admit a
widthxheightstream atfpscarrying up tobitrate_bps(0 where no rate is declared), as level_idc (41 = 4.1, 52 = 5.2, 62 = 6.2). - h264_
reference_ level - The level an x264 session declares so its decoded picture buffer holds
REFERENCE_FRAMES: the lowest fromlevelup to 5.2 whose buffer admits them atwidthxheight, else 5.2, orlevelitself above 5.2. - h265_
dpb_ frames - The reference frames an H.265 stream at
levelmay hold for awidthxheightpicture: the decoded picture buffer A.4.2 sizes (six pictures at the level’s full MaxLumaPs, more for a smaller picture) less the picture being decoded, at mostREFERENCE_FRAMES. - h265_
frame_ type - Wire frame kind of one encoded H.265 access unit: an IRAP picture (BLA, IDR, or CRA, which every backend here emits as an IDR with its parameter sets) is a key, anything else a delta.
- h265_
level - Lowest H.265 level whose Annex-A Tables A.8 and A.9 limits admit a
widthxheightstream atfpscarrying up tobitrate_bps(0 where no rate is declared) at the High tier or the Main one, as general_level_idc (123 = 4.1, 156 = 5.2, 186 = 6.2). - h265_
tier - The tier an H.265 session declares at
level(general_level_idc): High (1) from level 4.0 up, where Annex A defines one and every decoder of those levels takes it, so a CBR target above the level’s Main-tier MaxBR is not refused by an encoder that validates the two together; Main (0) below, where no High tier exists. - parse_
video_ type - The codec and frame kind a video type byte carries.
- push_
jpeg_ header - Append the header of one JPEG stripe.
- push_
video_ header - Append the header of one encoded video frame or stripe: the tag, the codec and frame kind, then the frame id, the stripe’s top row, its width and height, and the id of the frame it predicts from, all big-endian u16. A frame that predicts from none, or whose encoder does not say, names itself there.
- vp8_
is_ key - Whether a VP8 frame is a key frame: the frame tag’s lowest bit is clear.
- vp9_
base_ q_ idx - The
base_q_idxof a VP9 frame, read from its uncompressed header past the color configuration, the frame size, the references, and the loop filter; None for a shown existing frame or a header cut short. - vp9_
is_ key - Whether a VP9 frame is a key frame, read from its uncompressed header: not a shown existing
frame, and
frame_typeKEY_FRAME. Profile 3 carries one reserved bit ahead of those two. - vpx_
level - The libvpx / SVT-AV1 quantizer level (0..=63) closest to a quantizer index of
codec’s domain: the software encoders take the level, the hardware ones the index.