Skip to main content

a Python extension that provides bindings to WebRTC M92

Project description

python-webrtc logo
A 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 follows the W3C specification with some modifications and additions to make it work better with Python applications, with useful APIs like programmatic audio and video.

DISCLAIMER

This project is still under development and isn't ready for any serious use! In the current stage it's possible to establish connection and work with audio with a large number of segfaults and sigbuses. ✨

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 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

Installing

Pre-built wheel:

pip3 install --pre wrtc

Build from sources:

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

Documentation

The documentation is live at readthedocs.io.

Getting help

You can get help in several ways:

Contributing

Contributions of any sizes are welcome.

Special thanks to

License

The python-webrtc is published under the 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.dev6.tar.gz (220.5 kB view hashes)

Uploaded Source

Built Distributions

wrtc-0.0.0.dev6-cp310-cp310-win_amd64.whl (5.3 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

wrtc-0.0.0.dev6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (7.6 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.24+ x86-64

wrtc-0.0.0.dev6-cp310-cp310-macosx_11_0_arm64.whl (5.4 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

wrtc-0.0.0.dev6-cp310-cp310-macosx_10_9_x86_64.whl (6.5 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

wrtc-0.0.0.dev6-cp39-cp39-win_amd64.whl (5.3 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

wrtc-0.0.0.dev6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (7.6 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.24+ x86-64

wrtc-0.0.0.dev6-cp39-cp39-macosx_11_0_arm64.whl (5.4 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

wrtc-0.0.0.dev6-cp39-cp39-macosx_10_9_x86_64.whl (6.5 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

wrtc-0.0.0.dev6-cp38-cp38-win_amd64.whl (5.3 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

wrtc-0.0.0.dev6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (7.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.24+ x86-64

wrtc-0.0.0.dev6-cp38-cp38-macosx_11_0_arm64.whl (5.4 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

wrtc-0.0.0.dev6-cp38-cp38-macosx_10_9_x86_64.whl (6.5 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

wrtc-0.0.0.dev6-cp37-cp37m-win_amd64.whl (5.3 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

wrtc-0.0.0.dev6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (7.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.24+ x86-64

wrtc-0.0.0.dev6-cp37-cp37m-macosx_10_9_x86_64.whl (6.5 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

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