Repository navigation
Conversation
…ll back to RTX The static client configuration disabled H.264 publishing for Firefox on "linux" or "android". It was added for Firefox for Android (livekit#2183, livekit#2190), but the user agent parser reports Firefox for Android as os "android", so the "linux" clause only ever matched desktop Linux Firefox, which can publish H.264 via OpenH264. Narrow the rule to Android. With video/h264 as the only enabled video codec, that rule left desktop Linux Firefox with enabledPublishCodecs = [video/rtx, audio/opus, audio/red]. Its VP8 request then fell back via selectAlternativeVideoCodec, which returns the first video/ entry, so the track was registered as video/rtx while H.264 packets arrived ("could not find codec for webrtc receiver") and no subscriber could decode it. Skip RTX and FEC formats when picking an alternative codec. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Krithin Sitaram seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
krithin
marked this pull request as draft
October 5, 2026 00:44
Contributor
|
This was partially addressed in #4930. Not enabling H.264 for Linux. That needs more evaluation as some distributions may not have it. |
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.
Fixes #4929
Problem
When
enabled_codecslists H.264 as the only video codec, desktop Linux Firefox's camera track is registered asvideo/rtxand no subscriber can decode it:firefox && (linux || android). That rule was added for Firefox for Android (Remove un-preferred codecs for android firefox #2183, Disable h264 for android firefox #2190). The user agent parser reports Firefox for Android asos: "android", so thelinuxclause only matches desktop Linux Firefox, which can publish H.264 via OpenH264.[video/rtx, audio/opus, audio/red].selectAlternativeVideoCodecreturns the firstvideo/entry, which isvideo/rtx.Changes
pkg/clientconfiguration/conf.go: narrow the Firefox H.264 publish rule toc.os == "android". The Xiaomi 2201117TI clause is unchanged.pkg/rtc/mediaengine.go:selectAlternativeVideoCodecskips RTX, ULPFEC and FlexFEC, so it returns a real video codec or the VP8 default.ClientInfo.ComplyWithCodecOrderInSDPAnswer()inpkg/rtc/clientinfo.gohas the same(linux || android) && firefoxshape from #2183. I left it alone: it only trims the codecs offered in desktop Firefox's SDP answer, which didn't cause a problem here. Happy to narrow it too if you'd prefer the two rules to match.Testing
TestStaticConfigurationFirefoxH264Publishchecks client info as the server parses it: H.264 publish stays disabled forFirefox Mobile/AndroidandFirefox/Android, and is allowed forFirefox/LinuxandChrome/Linux.TestSelectAlternativeVideoCodeccovers RTX first, RTX after H.264, FEC entries, and no video codec at all.master(desktop Linux Firefox/expected "video/VP8", actual "video/rtx") and pass with this change.go test ./pkg/clientconfiguration/ ./pkg/rtc/passes.MimeTypeFlexFEC03dropped, because the protocol version pinned by v1.13.6 doesn't have it), self-hosted on arm64, withenabled_codecs: [audio/opus, audio/red, video/h264]. Desktop Firefox 156 on Linux publishedvideo/H264with all three simulcast layers, alongside an Element X Android client publishingvideo/H264. Both sides saw each other's video. There were nofalling back to alternative video codec/could not find codec for webrtc receiverlines, and the server forwarded about 2.7 Mbit/s of video. A second run added Element X on iOS 18.7 (JS SDK 2.21.0 in WKWebView): it fell back from VP8 tovideo/H264and published all three simulcast layers alongside desktop Linux Firefox, again with nocould not find codeclines. On stock v1.13.6 with the same config, the Firefox track was registered asvideo/rtxand showed as a blank tile.Not tested: Firefox for Android. Its rule is deliberately unchanged.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DLqi1aZH5ZCxHdAMP9BP3c