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
Video Encoder: VP9 from a 4:4:4 input comes out as profile 3, which WHIP Output refuses #1176
builtin.videoenc with codec=vp9 produces VP9 in profile 3 when its input is 4:4:4. WHIP Output then refuses the stream, correctly:
WHIP Output needs VP9 in profile 0, but its video input is VP9 profile 3, which WebRTC receivers do not all decode
This is easy to hit: videotestsrc negotiates Y444 when the encoder accepts it, so a plain test flow videotestsrc -> Video Encoder (vp9) -> WHIP Output fails. Any 4:4:4 or 10-bit source does the same. WebRTC receivers expect VP9 profile 0 (8-bit 4:2:0).
Cause
For H.264 and H.265, get_codec_caps_string pins profile= on the capsfilter after the encoder, and that steers the encoder back to a 4:2:0 input (Profile::Auto).
For VP9 and AV1 it returns the bare media type (video/x-vp9, video/x-av1), so the encoder follows whatever pixel format arrives. videoconvert passes Y444 through untouched, because vp9enc accepts it.
Pinning the profile after the encoder does not work for VP9. vp9enc does not choose its input format from a downstream profile, so the pipeline fails instead:
With Profile::Auto, constrain the raw format in front of the VP9 encoder to 8-bit 4:2:0 (for example I420/NV12, whatever the chosen encoder takes in system memory). Then videoconvert converts a 4:4:4 or 10-bit input, and the output is profile 0. Profile::None keeps today's free negotiation.
GPU memory must still pass the converter untouched (see the videoconvert comment in videoenc.rs, #1104), so the constraint has to apply only to system memory, or to the formats the hardware encoders take.
AV1 likely has the same gap: no profile on the caps, so 4:4:4 input gives AV1 High. Not verified.
Test case
A guard test: videotestsrc (which negotiates Y444) into the real VideoEncBuilder with codec=vp9 and default profile. It asserts that the encoder's output caps say profile=0, and fails if the constraint is removed.
About: By default the block pins an 8-bit 4:2:0 profile for H.264/H.265, but not for VP9/AV1. A 4:4:4 or 10-bit input then gives VP9 profile 1-3, and WHIP Output refuses it as it should.
Relates to:#782 / merged #850 (the same fix for H.264/H.265, which left VP9/AV1 out); merged #1086 (added WHIP Output's VP9 profile check); #1163 / merged #1178 (QSV VP9 is gone on Windows).
References:vp9enc docs: its 8-bit 4:2:0 inputs are I420/YV12, not NV12.
Thoughts: The allowed 4:2:0 formats differ per encoder (vp9enc takes I420, not NV12), so the constraint is best derived from the chosen encoder's sink caps, for system memory only, so GPU memory still passes (#1104). AV1 is unverified. WHIP Output does not take AV1, so AV1 matters for other targets.
Activity
srperens commentedon Oct 29, 2026
Area: Video Encoder block, VP9/AV1 output profile
About: By default the block pins an 8-bit 4:2:0 profile for H.264/H.265, but not for VP9/AV1. A 4:4:4 or 10-bit input then gives VP9 profile 1-3, and WHIP Output refuses it as it should.
Relates to: #782 / merged #850 (the same fix for H.264/H.265, which left VP9/AV1 out); merged #1086 (added WHIP Output's VP9 profile check); #1163 / merged #1178 (QSV VP9 is gone on Windows).
References: vp9enc docs: its 8-bit 4:2:0 inputs are
I420/YV12, notNV12.Thoughts: The allowed 4:2:0 formats differ per encoder (
vp9enctakesI420, notNV12), so the constraint is best derived from the chosen encoder's sink caps, for system memory only, so GPU memory still passes (#1104). AV1 is unverified. WHIP Output does not take AV1, so AV1 matters for other targets.fix(videoenc): keep VP9 at profile 0 and AV1 at Main by default
fix(videoenc): keep VP9 at profile 0 and AV1 at Main by default (Eyev…