Choosing a Python WebRTC library
Four libraries bring WebRTC to Python: Python WebRTC (wrtc on PyPI), aiortc, LiveKit’s Python SDK and GStreamer’s
webrtcbin. This page compares them as of 24 October 2026, with a source for every fact about the others in
Sources.
Which one, and when
Python WebRTC: you want libwebrtc, the WebRTC engine of Chrome, with the browser’s API, peer-to-peer to any WebRTC endpoint: browsers, SFUs, media servers, AI voice APIs. Prebuilt wheels for Linux, macOS and Windows, free-threaded Python included.
aiortc: you need ORTC objects below the peer connection, such as a standalone
RTCIceTransport, a protocol stack written in Python that you can read and patch, less memory per connection than Python WebRTC, or a release line marked stable. Python WebRTC is a pre-1.0 beta. aiortc’s own examples run on Python WebRTC with only their imports changed: see Migrating from aiortc.LiveKit SDK: you build on LiveKit: its rooms, LiveKit Cloud or a self-hosted LiveKit server. It connects to a LiveKit server only, not to other WebRTC endpoints.
GStreamer webrtcbin: your media already lives in GStreamer pipelines, such as capture devices, hardware encoders, RTSP sources or mixing, and WebRTC is one more element in them.
Features
Python WebRTC |
aiortc |
LiveKit SDK |
GStreamer webrtcbin |
|
|---|---|---|---|---|
Engine |
libwebrtc M152 |
own, in Python |
libwebrtc M150, through Rust |
own, in C |
Connects to |
any WebRTC endpoint |
any WebRTC endpoint |
a LiveKit server |
any WebRTC endpoint |
API |
W3C, asyncio |
close to W3C, asyncio |
rooms and tracks, asyncio |
GObject signals |
Media path |
native |
Python |
native |
native |
Video codecs |
VP8, VP9, AV1, H.264 |
VP8, H.264 |
VP8, VP9, AV1, H.264, H.265 |
installed plugins |
Audio codecs |
Opus, G.722, G.711 |
Opus, G.722, G.711 |
Opus, G.711 |
installed plugins |
Trickle ICE |
✅ |
half |
✅ |
✅ |
Simulcast |
✅ sending |
❌ |
✅ |
since 1.22 |
Encoded transforms |
✅ |
❌ |
❌ |
— |
End-to-end encryption |
✅ SFrame |
❌ |
✅ AES-GCM |
— |
Free-threaded Python |
✅ 3.14t, 3.15t |
— |
— |
GIL turned back on |
Python |
3.9–3.15 |
3.10+ |
3.9+ |
3.10–3.14 |
Wheels |
Linux, macOS, Windows |
pure Python |
Linux, macOS, Windows |
macOS, Windows |
Tested with |
browsers’ web-platform-tests |
own suite, browser interop |
own suite |
own unit tests |
Latest release |
0.1.0 beta, Oct 2026 |
1.15.0 stable, Jul 2026 |
1.1.21, Oct 2026 |
1.28.8, Oct 2026 |
— means the documentation doesn’t say.
Media path. Native means RTP, encoding and decoding run outside Python, and your code sees frames. aiortc runs RTP, RTCP and its jitter buffer in Python, with DTLS by OpenSSL, SRTP by libsrtp and codecs by FFmpeg.
H.264. Python WebRTC uses VideoToolbox on macOS, and Cisco’s OpenH264 elsewhere after one
openh264.install()call: it never bundles H.264. See H.264. aiortc encodes with x264 from PyAV’s wheels. LiveKit uses hardware encoders where it has them and a bundled OpenH264 otherwise.LiveKit. H.265 needs a hardware encoder: VideoToolbox on macOS, NVENC on Linux x86_64. Opus and G.711 are the server’s default audio codecs.
GStreamer. Its Windows wheels for 3.13t and 3.14t ship PyGObject 3.50, which doesn’t declare free-threading support, so Python turns the GIL back on. It has no Linux wheels: Linux distributions package it.
Tests. Python WebRTC runs the browsers’ web-platform-tests unmodified, through a binding shim in
tests/wpt, whoseexpectations.jsonlists what doesn’t pass.
Performance
The benchmarks compare Python WebRTC with aiortc on one Apple M1. Python WebRTC opens a data channel in 3.5 ms against 29.0 ms, moves 7.7–14.6x the data and spends 25–70% of aiortc’s CPU on audio. aiortc uses less memory per connection and less CPU per frame sending VP8 and receiving video calls; the benchmarks page explains why. The LiveKit SDK and GStreamer aren’t measured.
Sources
The facts about the other libraries, as checked on 24 October 2026. Links to code point at the release compared.
Show the sources
aiortc
The README: the Python implementation on asyncio, ORTC, half-trickle ICE, and interop testing with Chrome and Firefox.
The codec list, the H.264 codec on x264 and FFmpeg, and the changelog: G.722 since 1.13.0, PyAV for every codec since 1.12.0.
The API reference: the ORTC objects, and no send encodings, simulcast or encoded transforms.
The jitter buffer, and the pyproject.toml with its dependencies on PyAV, pyOpenSSL and pylibsrtp.
PyPI: version 1.15.0 of 13 July 2026, Python 3.10+, the Production/Stable classifier and the single
py3-none-anywheel.
LiveKit SDK
The README: rooms, the connection to LiveKit Cloud or a self-hosted server, Python 3.9+, and the table of hardware codecs by platform.
The Rust SDK it is built on, its
libwebrtccrate, “Livekit safe bindings to libwebrtc”, and, at the commit 1.1.21 builds on, the.gclientthat pinsm150_releaseand the session that trickles candidates over LiveKit’s signalling.The
TrackPublishOptionsdefinition and the advanced media guide: simulcast.The server’s default codecs: Opus and G.711.
The Python reference: its modules, with no encoded-frame transform (
encoded_videopublishes frames encoded elsewhere), and E2EE, with AES-GCM. The encryption guide.The tests workflow.
PyPI: version 1.1.21 of 16 October 2026 and its wheels.
GStreamer webrtcbin
The element’s documentation: its package, its signals (
create-offer,on-ice-candidate,add-ice-candidateand others) and “implements the majority of the W3’s peerconnection API”.The rtp plugin’s payloaders, and the AV1 one.
The 1.22 release notes: “Initial support for sending or receiving simulcast streams”.
The 1.28 release notes: the wheels for macOS and Windows, and 1.28.8 of 8 October 2026. The Linux install guide: “included in all Linux distributions”.
The unit tests of webrtcbin.
PyPI:
gstreamer-python1.28.8, its wheels for CPython 3.10–3.14 and the free-threaded ones for Windows.The build recipe of the wheels’ PyGObject 3.50.2, its module, and Python’s free-threading guide: “The GIL may also automatically be enabled when importing a C-API extension module that is not explicitly marked as supporting free threading.”