--- id: aiortc version: "1.15.0" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # aiortc — An implementation of WebRTC and ORTC License: permissive · Maintenance: active · Downloads: 2.2M/mo ## 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 above — 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 pip install aiortc uv add aiortc poetry add aiortc ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 2.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags webrtc python asyncio, real-time communication library, audio video streaming python, data channels peer-to-peer, ortc implementation python, asyncio webrtc, peer-to-peer video python, webrtc, peer-to-peer, real-time-communication [View on SkillFed](https://skillfed.io/packages/aiortc) · [View on PyPI](https://pypi.org/project/aiortc/)