Skip to main content

a Python Extension that provides bindings to WebRTC M92

Project description

python-webrtc
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.

DISCLAIMER

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 ✨

Snippet

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()
    pc.add_track(track)

    local_sdp = await pc.create_offer()
    print(local_sdp.sdp)


if __name__ == '__main__':
    asyncio.run(main())

Requirements

Pre-built wheels:

  • Python 3.7 or higher
  • Pip 21+
  • And compatible platform:
Linux macOS Windows
armv7l arm64 x64 x64 M1 x64
Python 3.7
3.8
3.9
3.10

Building from sources (sdist):

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

Full building instruction will be present later

Installing

❗️ Pre-built wheels were not published on PyPi for now!

Pre-built wheel:

pip3 install --pre wrtc

Build from sources:

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

Documentation

wrtc's documentation lives at readthedocs.io.

Getting help

You can get help in several ways:

Contributing

Contributions of all sizes are welcome.

Special thanks to

License

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wrtc-0.0.0.dev2.tar.gz (212.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page