fix(videoenc): replace "auto" profile with "none" default and expand codec profile enum - #569
Merged
Conversation
…codec profile enum The "profile" property previously had an "auto" value that mapped to H.264 baseline / H.265 main — a WebRTC-compatibility choice baked into a codec property. That mixed protocol concerns into the codec layer and left users guessing whether "auto" would adapt to their downstream (it did not — it was hardcoded). Replace with "none" (new default) which omits the profile field from the capsfilter, letting the encoder negotiate freely with downstream. This is the right default for SRT/MPEG-TS muxers and for hardware encoders (NVENC, VA-API) that won't reconfigure to match a pinned profile. WHEP/WebRTC pipelines now explicitly pick "baseline" / "main". Expand the enum to cover the codec profiles GStreamer encoders actually produce: H.264 adds high-4:2:2 and high-4:4:4; H.265 adds main-10, main-12, main-422-10/12, main-444/-10/-12, main-still-picture. Verified accepted values via gst-inspect-1.0 on x264enc, x265enc, nvh264enc and nvh265enc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…fault Introduce a typed Profile enum in strom-types as the single source of truth for the videoenc block's profile property. The enum drives the GStreamer caps string, the BlockDefinition's EnumValue list, the default value, and the UI label — so renaming or extending profiles only requires editing one place. The backend parser parse_profile() follows the same shape as the existing parse_encoder_preference / parse_rate_control helpers: unknown or missing values silently fall back to Profile::default() (Profile::None) and log a warn. This means stray "auto" values in saved flows.json (from the brief 0.5.0 window when "auto" was the default) are normalised on load — no migration required, no invalid strings ever reach a capsfilter. Per project rule, shared/API-visible enum values live in strom-types rather than the backend. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
profileproperty's"auto"value (a hidden WebRTC-compatibility mapping baked into a codec property) with"none"as the new default."none"omits theprofile=field from the encoder's output capsfilter so the encoder negotiates freely with downstream — the right behavior for SRT/MPEG-TS muxers and for hardware encoders (NVENC, VA-API) that won't reconfigure to match a pinned profile.high-4:2:2andhigh-4:4:4; H.265 addsmain-10,main-12,main-422-10/12,main-444/-10/-12,main-still-picture.gst-inspect-1.0forx264enc,x265enc,nvh264enc,nvh265enc.baseline(H.264) ormain(H.265) — both are still in the enum.Test plan
cargo test --lib blocks::builtin::videoenc::tests::test_get_codec_caps_stringcargo test --test openapi_testProfiledropdown shows the new options and thatnoneis the pre-selected default for new VideoEncoder blocks🤖 Generated with Claude Code