Hi HN, author here. This project binds libwebrtc (the engine inside Chrome) to Python. The API follows the W3C specifications, so it's almost identical to the browser's JavaScript API. If you've used WebRTC in the browser, the API should feel familiar. Media processing stays outside Python. The API also includes ReadableStream, WritableStream and TransformStream.
I posted an alpha version here in 2022. Back then, I finished only part of the API in the entire month. The scope was too much for me. This year, I came back with AI helping with the implementation. I handled the design and reviews; I use web platform tests as a regression suite via a shim and PythonMonkey, which embeds Firefox's SpiderMonkey engine in Python.
The hardest part was managing object lifetimes across libwebrtc's threads and Python's garbage collector. My design decisions were inspired by a great article by Philip Chimento, which explored similar problems in GJS, the JavaScript bindings for GNOME: https://ptomato.wordpress.com/2018/11/06/taking-out-the-garb...
It's still v0.1 and in beta. I think the API is mostly there, but it needs more real-world testing. There is no mobile support yet, and H.264 uses Apple's VideoToolbox on macOS or Cisco’s binaries elsewhere.
Hi HN, author here. This project binds libwebrtc (the engine inside Chrome) to Python. The API follows the W3C specifications, so it's almost identical to the browser's JavaScript API. If you've used WebRTC in the browser, the API should feel familiar. Media processing stays outside Python. The API also includes ReadableStream, WritableStream and TransformStream.
I posted an alpha version here in 2022. Back then, I finished only part of the API in the entire month. The scope was too much for me. This year, I came back with AI helping with the implementation. I handled the design and reviews; I use web platform tests as a regression suite via a shim and PythonMonkey, which embeds Firefox's SpiderMonkey engine in Python.
The hardest part was managing object lifetimes across libwebrtc's threads and Python's garbage collector. My design decisions were inspired by a great article by Philip Chimento, which explored similar problems in GJS, the JavaScript bindings for GNOME: https://ptomato.wordpress.com/2018/11/06/taking-out-the-garb...
It's still v0.1 and in beta. I think the API is mostly there, but it needs more real-world testing. There is no mobile support yet, and H.264 uses Apple's VideoToolbox on macOS or Cisco’s binaries elsewhere.
Benchmarks are here https://wrtc.marshal.dev/benchmarks/