Is there an implementation of RTCPeerConnection in Python? I have a Python app that is going to act as a peer in a video sharing app (other peer is a browser). There's plenty of examples of signaling servers in Python but I can't find any implementations of RTCPeerConnection itself. I do not want to use something like PyQt and webkit, etc.
WebRTC is an open-source project providing peer-to-peer, real-time communication capabilities to web browsers, mobile devices, and any other device that can run code using the available APIs for Javascript, Python, . NET, Golang, and more.
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.
The "WebRTC" (Web Real-Time Communication) is an open-source protocol that allows real-time communication and data sharing between different browsers and devices. It allows sharing of voice, video, and data over the web. It is a protocol that sets two-way communication between two browsers in real-time.
You are right in stating that most examples on the web related to WebRTC / Python only use Python for signaling.
I believe one reason for the lack of a Python-based WebRTC implementation so far was that WebRTC is a fairly complex stack involving SDP negotiation, Interactive Connectivity Establishment to find a path between two peers, DTLS handshake + SRTP encryption, all this happening in an asynchronous fashion.
With the availability of asyncio however, the picture has changed somewhat, as it is now possible to write asynchronous code in a more linear fashion, without resorting to callbacks.
As a result, I have put together an asyncio-based WebRTC implementation for Python which I believe will fit nicely with the usecase you describe:
https://github.com/aiortc/aiortc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With