Skip to content

Commit c62b639

Browse files
steveseguinclaude
andcommitted
fix(gstreamer): Strip audio from SDP for GStreamer < 1.20
GStreamer 1.18 has multiple audio SDP bugs that Chrome rejects: - Invalid SSRC handling - Incorrect rtcp-fb attributes on audio - Bundle/port issues with audio section Rather than trying to patch all the issues individually, strip the audio section from the SDP entirely for GStreamer < 1.20. This allows video to work reliably. Users need GStreamer 1.20+ for audio support. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 10e31ee commit c62b639

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

publish.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6931,20 +6931,15 @@ def on_offer_created(promise, _, __):
69316931
printc("Patching SDP due to Gstreamer webRTC bug - audio-only issue", "A6F") # just chrome doesn't handle this
69326932
text = replace_ssrc_and_cleanup_sdp(text)
69336933

6934-
# Fix audio SSRC issues for GStreamer < 1.20 (1.18 has known SSRC bugs)
6934+
# GStreamer 1.18 has multiple audio SDP bugs that Chrome rejects:
6935+
# - Invalid SSRCs, rtcp-fb attributes, bundle issues
6936+
# Strip audio from SDP entirely for GStreamer < 1.20 as a workaround
69356937
gst_ver = Gst.version()
6936-
if not self.noaudio and gst_ver.major == 1 and gst_ver.minor < 20:
6938+
if gst_ver.major == 1 and gst_ver.minor < 20:
69376939
if 'm=audio' in text:
6938-
printc("Patching audio SDP for GStreamer 1.18 SSRC compatibility", "A6F")
6939-
text = fix_audio_ssrc_for_ohttp_gstreamer(text)
6940-
# Also remove video-specific rtcp-fb attributes from audio section
6941-
text = fix_audio_rtcp_fb_for_gstreamer(text)
6942-
6943-
# GStreamer 1.18 creates phantom audio section even with --noaudio
6944-
# Strip it from the SDP to avoid confusing Chrome
6945-
if self.noaudio and gst_ver.major == 1 and gst_ver.minor < 20:
6946-
if 'm=audio' in text:
6947-
printc("Stripping phantom audio section from SDP (GStreamer 1.18 bug)", "A6F")
6940+
if not self.noaudio:
6941+
printc("⚠️ Stripping audio from SDP (GStreamer 1.18 audio bugs)", "FA0")
6942+
printc(" └─ Upgrade to GStreamer 1.20+ for audio support", "FA0")
69486943
text = strip_audio_from_sdp(text)
69496944

69506945
text = self._ensure_primary_video_codec_in_sdp(text)

0 commit comments

Comments
 (0)