Skip to main content

An implementation of WebRTC and ORTC

Project description

aiortc License Version Python versions Tests Coverage Documentation

What is aiortc?

aiortc is a library for Web Real-Time Communication (WebRTC) and Object Real-Time Communication (ORTC) in Python. It is built on top of asyncio, Python’s standard asynchronous I/O framework.

The API closely follows its Javascript counterpart while using pythonic constructs:

  • promises are replaced by coroutines

  • events are emitted using pyee.EventEmitter

To learn more about aiortc please read the documentation.

Why should I use aiortc?

The main WebRTC and ORTC implementations are either built into web browsers, or come in the form of native code. While they are extensively battle tested, their internals are complex and they do not provide Python bindings. Furthermore they are tightly coupled to a media stack, making it hard to plug in audio or video processing algorithms.

In contrast, the aiortc implementation is fairly simple and readable. As such it is a good starting point for programmers wishing to understand how WebRTC works or tinker with its internals. It is also easy to create innovative products by leveraging the extensive modules available in the Python ecosystem. For instance you can build a full server handling both signaling and data channels or apply computer vision algorithms to video frames using OpenCV.

Furthermore, a lot of effort has gone into writing an extensive test suite for the aiortc code to ensure best-in-class code quality.

Implementation status

aiortc allows you to exchange audio, video and data channels and interoperability is regularly tested against both Chrome and Firefox. Here are some of its features:

  • SDP generation / parsing

  • Interactive Connectivity Establishment, with half-trickle and mDNS support

  • DTLS key and certificate generation

  • DTLS handshake, encryption / decryption (for SCTP)

  • SRTP keying, encryption and decryption for RTP and RTCP

  • Pure Python SCTP implementation

  • Data Channels

  • Sending and receiving audio (Opus / PCMU / PCMA)

  • Sending and receiving video (VP8 / H.264)

  • Bundling audio / video / data channels

  • RTCP reports, including NACK / PLI to recover from packet loss

Installing

The easiest way to install aiortc is to run:

pip install aiortc

Building from source

If there are no wheels for your system or if you wish to build aiortc from source you will need a couple of libraries installed on your system:

  • Opus for audio encoding / decoding

  • LibVPX for video encoding / decoding

Linux

On Debian/Ubuntu run:

apt install libopus-dev libvpx-dev

OS X

On OS X run:

brew install opus libvpx

License

aiortc is released under the BSD license.

Project details


Download files

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

Source Distribution

aiortc_rtp-1.10.1.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

aiortc_rtp-1.10.1-cp39-abi3-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.9+Windows x86-64

aiortc_rtp-1.10.1-cp39-abi3-win32.whl (923.5 kB view details)

Uploaded CPython 3.9+Windows x86

aiortc_rtp-1.10.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

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

aiortc_rtp-1.10.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

aiortc_rtp-1.10.1-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.9 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

aiortc_rtp-1.10.1-cp39-abi3-macosx_11_0_arm64.whl (899.1 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

aiortc_rtp-1.10.1-cp39-abi3-macosx_10_9_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9+macOS 10.9+ x86-64

File details

Details for the file aiortc_rtp-1.10.1.tar.gz.

File metadata

  • Download URL: aiortc_rtp-1.10.1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aiortc_rtp-1.10.1.tar.gz
Algorithm Hash digest
SHA256 3afb07e1252afb6dac4ae702f2365b4bafa61eb4a07e0655ddab4eb067be0e4b
MD5 e49330069ce9657b8e429652219d6ac9
BLAKE2b-256 60c7a90d055837f0e84b4b598c31805bc0485b8752a87177bb963024419816a5

See more details on using hashes here.

File details

Details for the file aiortc_rtp-1.10.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: aiortc_rtp-1.10.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aiortc_rtp-1.10.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a4b6d4af3ab5ae4bdcd4a904a1a1f30385deb12c7ef39e94b5657b0f84f1d752
MD5 9c140986152335bbef50942895a00b20
BLAKE2b-256 c51f291b57f42782fb617115353419c2086508bd62d5fe9c6d1084c5a3c10988

See more details on using hashes here.

File details

Details for the file aiortc_rtp-1.10.1-cp39-abi3-win32.whl.

File metadata

  • Download URL: aiortc_rtp-1.10.1-cp39-abi3-win32.whl
  • Upload date:
  • Size: 923.5 kB
  • Tags: CPython 3.9+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aiortc_rtp-1.10.1-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 e5bb4255eae3b5cf9f4350611fd6964c8a5137cc77893c6aee4c1d0536149a32
MD5 cc04befa3e7f881c67c98d26e256d146
BLAKE2b-256 b9b3e36bd519405103c15a60e2800f35b54aa9f9af47b492640cd8b75212567a

See more details on using hashes here.

File details

Details for the file aiortc_rtp-1.10.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for aiortc_rtp-1.10.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa2c66ec1d7f741a488b3dfbc06dbe39d26a02ce68022719c003548c750a2aa2
MD5 f5fa512cee9c88a4370ae273091f1895
BLAKE2b-256 27ef7484046b1ecf00bf0c21cdcd09c0d7ed041dca7b785401970c92c0ff314d

See more details on using hashes here.

File details

Details for the file aiortc_rtp-1.10.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for aiortc_rtp-1.10.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 98bd9fbc9ed338ee75236275c6d11cdd845fd4a1e9cfc7a851cdb036d739f1c5
MD5 d5152dc4f86d7d4d517e1247acc7722a
BLAKE2b-256 b2946e7b1f95ca36462351dcd3ca9f815e6bcd28004d7012b880f77f118093ef

See more details on using hashes here.

File details

Details for the file aiortc_rtp-1.10.1-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for aiortc_rtp-1.10.1-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a67a2ed97e7788b723b2303b1e5a365ddd54e2bc72e9736758b579d57ce9183d
MD5 8c9adf3b6c0ab1a3cec87b34ed139a6b
BLAKE2b-256 8d6129893d73dbd4fcd0a608a7e079cd954bbe9825680296695b193ceace56c7

See more details on using hashes here.

File details

Details for the file aiortc_rtp-1.10.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aiortc_rtp-1.10.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7d648962599f18beeb75eb03d7b90cae52a862713b60186f2e6cc1900a22285d
MD5 423a95eb62a79dce96436ef8f8d5d789
BLAKE2b-256 bb0da8dfedc450d47a20922285b10e0af5e69f39c76ac097cc3efd7a3e27950e

See more details on using hashes here.

File details

Details for the file aiortc_rtp-1.10.1-cp39-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for aiortc_rtp-1.10.1-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3c16ac2e4c339cd2f0416edc258f61146dfcaee8faf43d3bc6d8de35e3e97434
MD5 b08982f9c3891674e7c8963e303b8938
BLAKE2b-256 7cbf71bbd6ed153e1b8e6562b79c1622c997219a855b5dac0dae2b6de98ee4ea

See more details on using hashes here.

Supported by

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