Skip to content

Commit 56e489f

Browse files
steveseguinclaude
andcommitted
feat: Add GStreamer 1.18 framebuffer error detection and guidance
- Add proactive warning when using --framebuffer with GStreamer 1.18 - Add specific error handler for the jitterbuffer "code should not be reached" crash - Provide clear solutions: upgrade to GStreamer 1.20+, use Docker, or switch output modes - Help users avoid the known bug reported in GitLab issue #1326 This addresses the issue where GStreamer 1.18 crashes with framebuffer mode due to incomplete jitterbuffer handling in the WebRTC implementation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1a5fb84 commit 56e489f

1 file changed

Lines changed: 45 additions & 1 deletion

File tree

publish.py

100644100755
Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6010,7 +6010,28 @@ def on_message(bus: Gst.Bus, message: Gst.Message, loop):
60106010

60116011
elif mtype == Gst.MessageType.ERROR:
60126012
err, debug = message.parse_error()
6013-
print(err, debug)
6013+
6014+
# Check for GStreamer 1.18 jitterbuffer error
6015+
if "on_rtpbin_new_jitterbuffer" in str(debug) and "code should not be reached" in str(err):
6016+
printc("\n❌ KNOWN GSTREAMER 1.18 BUG DETECTED ❌", "F00")
6017+
printc("━" * 60, "F00")
6018+
printc("This error occurs with GStreamer 1.18 when using --framebuffer mode.", "F70")
6019+
printc("", "")
6020+
printc("SOLUTION:", "0F0")
6021+
printc("1. Upgrade to GStreamer 1.20 or newer (recommended)", "0F0")
6022+
printc(" - Ubuntu 22.04+ has GStreamer 1.20+", "07F")
6023+
printc(" - Debian 12+ has GStreamer 1.22+", "07F")
6024+
printc("", "")
6025+
printc("2. Use Docker with Ubuntu 22.04 on Debian 11:", "0F0")
6026+
printc(" docker run -it ubuntu:22.04 bash", "07F")
6027+
printc("", "")
6028+
printc("3. Use a different output mode instead of --framebuffer", "0F0")
6029+
printc(" - Try --filesink or --fdsink", "07F")
6030+
printc("━" * 60, "F00")
6031+
printc("See: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1326", "77F")
6032+
else:
6033+
print(err, debug)
6034+
60146035
loop.quit()
60156036

60166037
elif mtype == Gst.MessageType.WARNING:
@@ -6635,6 +6656,29 @@ async def main():
66356656
if not np:
66366657
print("You must install Numpy for this to work.\npip3 install numpy")
66376658
sys.exit()
6659+
6660+
# Check for GStreamer 1.18 bug with framebuffer mode
6661+
gst_version = Gst.version()
6662+
if gst_version.major == 1 and gst_version.minor == 18:
6663+
printc("\n⚠️ WARNING: GStreamer 1.18 detected with --framebuffer mode", "F70")
6664+
printc("━" * 60, "F70")
6665+
printc("GStreamer 1.18 has a known bug that causes crashes in framebuffer mode.", "F70")
6666+
printc("You may encounter: 'ERROR:gstwebrtcbin.c:5657:on_rtpbin_new_jitterbuffer'", "F70")
6667+
printc("", "")
6668+
printc("RECOMMENDED SOLUTIONS:", "0F0")
6669+
printc("1. Upgrade to GStreamer 1.20 or newer", "0F0")
6670+
printc(" - Ubuntu 22.04+ has GStreamer 1.20+", "07F")
6671+
printc(" - Debian 12+ has GStreamer 1.22+", "07F")
6672+
printc("2. Use Docker: docker run -it ubuntu:22.04", "0F0")
6673+
printc("3. Use --filesink or --fdsink instead of --framebuffer", "0F0")
6674+
printc("━" * 60, "F70")
6675+
printc("Press Ctrl+C to exit or wait 5 seconds to continue anyway...", "F70")
6676+
try:
6677+
time.sleep(5)
6678+
except KeyboardInterrupt:
6679+
printc("\nExiting due to GStreamer 1.18 compatibility issue.", "F00")
6680+
sys.exit(1)
6681+
66386682
args.streamin = args.framebuffer
66396683
elif args.record_room or args.room_ndi:
66406684
# Room recording mode (check this first before regular record)

0 commit comments

Comments
 (0)