什么语言更适合 P2P 视频流?

发布于 2024-09-04 22:10:31 字数 1432 浏览 11 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深居我梦 2024-09-11 22:10:31

您感兴趣的功能可能涉及较高的网络流量(用于视频流)和 CPU 使用率(用于面部识别)。因此,效率在您的最终产品中非常重要,这意味着您希望这些关键部分由本机代码(可能是用 C 或 C++ 编写)处理。

另一方面,您需要一种易于编程的语言,这在您进行实验和原型设计时非常合适。一种表达性语言可以通过少量代码使您的含义变得清晰,这将帮助您专注于解决面前的问题,而不是陷入实现细节的困境。 Python 是一个非常好的选择。 (事实上​​,Python 是其他几个 p2p 项目的开发语言,包括 BitTorrent< /a>、P2P-Next 以及我自己的视频流系统。)

请允许我建议采用这种方法:

  1. 使用 Python 等高级语言开发您的第一个版本。
  2. 使用编译的库进行视频帧处理。几个主要的多媒体库都有 python 绑定,包括 gstreamerlibavcodec
  3. 一旦您有了工作原型并且对您的设计感到满意,请考虑用 C 或 C++ 重新实现系统。

The functionality you're interested in is likely to involve somewhat heavy network traffic (for video streaming) and CPU usage (for facial recognition). Efficiency is therefore going to matter quite a bit in your final product, which implies that you'll want those critical parts to be handled by native code, probably written in C or C++.

On the other hand, you're asking for a language that's easy to program, which is very appropriate while you're experimenting and prototyping. An expressive language that makes your meaning clear in a small amount of code will help you focus on solving the problems before you, rather than getting bogged down in implementation details. Python is a very good choice for this. (As a matter of fact, Python was the development language of several other p2p projects including BitTorrent, P2P-Next, and my own video streaming system.)

Allow me to suggest this approach:

  1. Develop your first version in a high level language like Python.
  2. Use compiled libraries for video frame processing. Several major multimedia libraries have python bindings, including gstreamer and libavcodec.
  3. Once you have a working prototype and are satisfied with your design, consider re-implementing the system in C or C++.
薄荷梦 2024-09-11 22:10:31

我会说 flash,因为这个插件很普遍,你有一种高级语言,它已经有一个用于流视频的 API,所以你不必在 C 中重新发明轮子。

I would say flash, because the plugin is widespread, you have a high level language and it already have a API for streaming video, so you do not have to reinvent the wheel in C.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文