Skip to content

Video Encoder: VP9 from a 4:4:4 input comes out as profile 3, which WHIP Output refuses #1176

Closed

Description

@srperens

Problem

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:

$ gst-launch-1.0 -v videotestsrc num-buffers=3 ! video/x-raw,width=320,height=240 ! videoconvert ! vp9enc deadline=1 ! vp9parse ! fakesink
... format=(string)Y444 ... profile=(string)3

$ gst-launch-1.0 videotestsrc num-buffers=3 ! video/x-raw,width=320,height=240 ! videoconvert ! vp9enc deadline=1 ! vp9parse ! 'video/x-vp9,profile=(string)0' ! fakesink
ERROR: from element /GstPipeline:pipeline0/GstVP9Enc:vp9enc0: Invalid vpx profile

(GStreamer 1.28.6, macOS.)

Proposed direction

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.

Activity

  1. srperens commented on Oct 29, 2026

    @srperens
    CollaboratorAuthor

    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, 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.

  2. added a commit that references this issue on Nov 3, 2026
    3f07972
  3. added a commit that references this issue on Nov 11, 2026
    0d0083a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions