WebRTC Python 实现 [英] WebRTC Python implementation

查看:41
本文介绍了WebRTC Python 实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python 中是否有 RTCPeerConnection 的实现?我有一个 Python 应用程序,它将充当视频共享应用程序中的对等点(另一个对等点是浏览器).Python中有很多信令服务器的例子,但我找不到 RTCPeerConnection 本身的任何实现.我不想使用 PyQt 和 webkit 之类的东西.

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/Python 相关的大多数示例仅使用 Python 进行信号传输.

You are right in stating that most examples on the web related to WebRTC / Python only use Python for signaling.

我认为到目前为止缺乏基于 Python 的 WebRTC 实现的一个原因是 WebRTC 是一个相当复杂的堆栈,涉及 SDP 协商、交互式连接建立以找到两个对等点之间的路径、DTLS 握手 + SRTP 加密,所有这些以异步方式发生.

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.

然而,随着 asyncio 的出现,情况发生了一些变化,因为现在可以以更线性的方式编写异步代码,而无需求助于回调.

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.

因此,我为 Python 组合了一个基于 asyncio 的 WebRTC 实现,我相信它非常适合您描述的用例:

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

这篇关于WebRTC Python 实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆