Skip to content

Advertise pass-through video formats without requiring a local real e… - #1452

Closed
stephen-derosa wants to merge 1 commit into
mainfrom
sderosa/jetson-claude-add-jetson-h265
Closed

stephen-derosa wants to merge 1 commit into
mainfrom
sderosa/jetson-claude-add-jetson-h265

Conversation

@stephen-derosa

Copy link
Copy Markdown
Contributor

No description provided.

@stephen-derosa stephen-derosa self-assigned this Sep 23, 2026
@stephen-derosa
stephen-derosa marked this pull request as draft September 23, 2026 00:39
@github-actions

Copy link
Copy Markdown
Contributor

Changeset incomplete

This PR's changeset is missing version bumps for packages that are affected by the change. The following packages still require a bump:

  • livekit-capture

Already covered:

  • libwebrtc (patch)
  • livekit (patch)
  • livekit-ffi (patch)
  • webrtc-sys (patch)

A package must be bumped when its own files change, and whenever a package it depends on is bumped (so downstream consumers get a matching release).

Click here to create a changeset for the missing packages

The link pre-populates a changeset file with patch bumps for the missing packages. You can also add them to your existing changeset. Edit the bump types as needed before committing.

If this change doesn't require a version bump, add the internal label to this PR.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment on lines 407 to +408
for (const auto& format : backend_factory.factory->GetSupportedFormats()) {
const bool codec_available = std::any_of(
formats.begin(), formats.begin() + real_format_count,
[&](const webrtc::SdpVideoFormat& existing) {
return IsSameCodecName(existing.name, format.name);
});
if (codec_available) {
formats.push_back(format);
}
formats.push_back(format);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Raw senders negotiate unusable codecs

GetSupportedFormats advertises pass-through-only codecs to raw senders. Untagged encoder creation excludes PreEncoded, so negotiation succeeds but the sender cannot encode.

Learn more

Encoder capabilities apply to every sender created by this peer connection factory. They do not carry the sender's later VideoEncoderBackend choice. These added formats are also untagged, while Create deliberately excludes PreEncoded from automatic fallback. The factory therefore promises support for formats that ordinary raw senders cannot instantiate.

Example: On a desktop without HEVC encoding, the factory advertises H.265. A raw sender can negotiate H.265 from that capability, but untagged Create skips the pass-through factory and returns null instead of an encoder.

Recommended fix: Preserve pass-through-only codecs without exposing them as ordinary encoder capabilities. Associate them with explicit PreEncoded selection before codec negotiation, or add sender-level capability filtering so only pre-encoded publications advertise them. Keep raw sender capabilities limited to formats accepted by untagged Create.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

…ncoder

A pre-encoded publisher supplies its own bitstream, so it does not need a
local encoder for its codec. GetSupportedFormats() previously dropped
pass-through formats for codecs no real encoder factory advertised, which
made pre-encoded H.265 publishes fail silently on machines without a
hardware HEVC encoder: H265 never appeared in the SDP offer, the sender
negotiated a different codec, and PassthroughVideoEncoder then rejected
every frame with "frame codec does not match sender codec" while
captureFrame kept reporting frames as accepted.

Advertising the pass-through formats unconditionally is safe because the
pass-through backend is never selected automatically - it is excluded from
automatic fallback and only used on an explicit publish request - and
Create() already fails loudly rather than falling back to a real encoder
for a pre-encoded sender.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@stephen-derosa
stephen-derosa force-pushed the sderosa/jetson-claude-add-jetson-h265 branch from 6f5e1f2 to 8e61b89 Compare October 19, 2026 20:46
@stephen-derosa

Copy link
Copy Markdown
Contributor Author

closing in favor of #1451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant