aiortc
An implementation of WebRTC and ORTC
What it is and what it does
aiortc is a pure-Python implementation of WebRTC and ORTC protocols built on asyncio, enabling peer-to-peer real-time communication directly from Python applications. Unlike browser-native WebRTC or native libraries, it provides readable, modular code that can be extended with Python ecosystem tools—making it suitable for building signaling servers, applying computer vision to video streams, or experimenting with WebRTC internals.
The library handles the full WebRTC stack: SDP generation, ICE connectivity, DTLS encryption, SRTP keying, SCTP data channels, and codec support for Opus/PCMU/PCMA audio and VP8/H.264 video. It includes RTCP reporting and packet-loss recovery (NACK/PLI), with interoperability regularly tested against Chrome and Firefox. Runtime dependencies include aioice for connectivity, av for media codec access, cryptography and pyopenssl for encryption, and pylibsrtp for secure RTP.
Use it for:
- Build a WebRTC signaling server that manages peer connections and relays SDP offers/answers
- Apply real-time computer vision or audio processing to incoming video/audio streams using Python libraries
- Create a peer-to-peer data channel application for low-latency messaging between Python clients
- Prototype or experiment with WebRTC protocol internals without diving into browser or native code
- Integrate live media streaming into a Python backend service with full control over codecs and routing
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
aiortc is a Python library implementing WebRTC and ORTC protocols for real-time audio, video, and data channel communication over asyncio, with interoperability tested against Chrome and Firefox.
Yes. aiortc is actively maintained, permissively licensed, and widely used (top 5000 PyPI packages by downloads). It's the right choice if you need WebRTC in Python and can accept the dependency on compiled media libraries. Not suitable if you need a lightweight data-only solution or cannot install system packages for av and pylibsrtp.
Install
aiortc on PyPI
pip
pip install aiortcuv
uv add aiortcpoetry
poetry add aiortcInstalling aiortc
Before you install
Low install friction with a pure-Python wheel; actively maintained with a recent release 32 days ago and active repository status. Depends on compiled libraries (av, cryptography, pylibsrtp) that may require system packages, but the package itself installs cleanly.
License in practice
Released under BSD-3-Clause (permissive), allowing commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install aiortc
from aiortc import RTCPeerConnection
from pyee.asyncio import AsyncIOEventEmitter
pc = RTCPeerConnection()
# Configure audio/video tracks and data channels
Requires Python 3.10 or later; av and pylibsrtp dependencies may need system libraries (libavformat, libsrtp) to compile.
Verify before relying
- Specific performance characteristics (latency, throughput) under typical workloads
- Production deployment patterns and known scaling limits
- Detailed comparison of feature completeness vs. browser-native WebRTC implementations
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — aioice, av, cryptography, google-crc32c, pyee, pylibsrtp, pyopenssl |
| Maintenance | actively maintained — 32 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,218,401/month — #3,202 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiortc-1.15.0-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
aioiceaioice implements Interactive Connectivity…
permissive · top 5,000 on PyPI
aiortspProvides asyncio-based RTSP client…
copyleft · top 15,000 on PyPI
streamlit-webrtcAdds real-time video and audio streaming over…
permissive · top 15,000 on PyPI
go2rtc-clientAsynchronous Python client library for…
permissive · top 15,000 on PyPI
aiocoapaiocoap is a Python library for writing CoAP…
permissive · top 15,000 on PyPI
pipecat-ai-small-webrtc-prebuiltProvides a ready-to-use WebRTC client UI for…
permissive · top 15,000 on PyPI
daily-pythonA Python SDK for building video and audio…
permissive · top 15,000 on PyPI
pipecat-aiPipecat is a Python framework for building…
permissive · top 5,000 on PyPI
livekitPython SDK for building real-time video, audio,…
permissive · top 5,000 on PyPI
webrtcvadProvides a Python interface to Google's WebRTC…
permissive · top 15,000 on PyPI