11

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.

1 Answer 1

27

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

Sign up to request clarification or add additional context in comments.

7 Comments

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
Could you expand on how my answer could be further improved please?
The real issue here is the question, not the answer. If someones asks for a library (which is not within the scope of SO's questions), the correct answer is a link to a library. But in general answers should work even without the link, i.e. a code snippet with a link to the original source or documentation would be fine.
@maximillian I disagree in this case as the question was generic. Might not be SO policy indeed however.
@jamie check the commit history, I am the author. I moved the aiortc repo to an organization some time ago as there are several related repos (pylibsrtp, aioice). I have updated the link in my answer.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.