python-webrtc logo Python Extension that provides bindings to WebRTC M92 Examples Documentation PyPI

Python WebRTC

Stop making unstandard pure implementations of WebRTC and let’s use the native library!

This project tries to be like W3C specification, but there is some edits out of specification. The changes were applied to make library more Pythonic and add useful API like programmatic audio and video.


This project under development and doesn’t redy for any serious use! In the current stage it’s possible to establish connection and working with audio. The project has segfaults and sigbuse in large numbers ✨


import asyncio
import webrtc

async def main():
    pc = webrtc.RTCPeerConnection()

    stream = webrtc.get_user_media()
    for track in stream.get_tracks():
        pc.add_track(track, stream)

    audio_source = webrtc.RTCAudioSource()
    track = audio_source.create_track()

    local_sdp = await pc.create_offer()

if __name__ == '__main__':


Pre-built wheels:

  • Python 3.7 or higher
  • pip 21 or higher
  • And compatible platform:
Linux macOS Windows
armv7l arm64 x86_64 Intel Apple Silicon 64bit
Python 3.7 N/A N/A N/A
3.8 N/A N/A
3.9 N/A N/A
3.10 N/A N/A

Building from sources (sdist):

  • ~15 GB of free disk space
  • CMake 3.14 or higher
  • GCC 7.5 or higher
  • glibc 2.18 or higher
  • ARM toolchain (ARM only)

Full building instruction will be present later


Pre-built wheel:

pip3 install --pre wrtc

Build from sources:

pip3 install --pre wrtc --no-binary wrtc


wrtc‘s documentation lives at

Getting help

You can get help in several ways:


Contributions of all sizes are welcome.

Special thanks to


The python-webrtc licence is BSD 3-Clause License.


View Github