Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

WebRTC and ORTC implementation for Python using asyncio

License

NotificationsYou must be signed in to change notification settings

aiortc/aiortc

aiortc

LicenseVersionPython versionsTestsCoverageDocumentation

What isaiortc?

aiortc is a library forWeb Real-Time Communication (WebRTC) andObject Real-Time Communication (ORTC) in Python. It is built on top ofasyncio, Python's standard asynchronous I/O framework.

The API closely follows its Javascript counterpart while using pythonicconstructs:

  • promises are replaced by coroutines
  • events are emitted usingpyee.EventEmitter

To learn more aboutaiortc pleaseread the documentation.

Why should I useaiortc?

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 plugin audio or video processing algorithms.

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

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

Implementation status

aiortc allows you to exchange audio, video and data channels andinteroperability is regularly tested against both Chrome and Firefox. Here aresome 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 installaiortc is to run:

pip install aiortc

Building from source

If there are no wheels for your system or if you wish to build aiortc fromsource 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 theBSD license.


[8]ページ先頭

©2009-2025 Movatter.jp