C# 开发具有高质量视频流的视频聊天应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/470698/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 04:41:32  来源:igfitidea点击:

Developing a Video Chat Application with high quality video streaming

c#videostreamingchat

提问by Sumit Ghosh

I am working for a company where we are developing video chat support on an existing application. I have looked at various solutions for this like

我在一家公司工作,我们正在为现有应用程序开发视频聊天支持。我已经看过各种解决方案,比如

  1. Using Managed Direct show for video capture and streaming in C#
  2. Some code samples in code project where we take an image and pass it over the network (I would call it rather a crude solution as this would eat up lot of bandwidth.
  3. Code a compression algorithm from scratch from scratch and use it to compress-decompress video.
  1. 在 C# 中使用托管直接显示进行视频捕获和流式传输
  2. 代码项目中的一些代码示例,我们拍摄图像并将其通过网络传递(我称之为粗略的解决方案,因为这会占用大量带宽。
  3. 从头开始编写压缩算法,并使用它来压缩-解压缩视频。

Now the challenge is that we are looking to achieve very high quality video streaming and the container application is coded in C#.NET

现在的挑战是我们正在寻求实现非常高质量的视频流,并且容器应用程序是用 C#.NET 编码的

This is what I have proposed so far. The network logic to stream data is written in C# , the video compression to be written in VC++ and call this VC++ dll using pinvoke or either CLI which way possible.

这是我迄今为止提出的建议。流数据的网络逻辑用 C# 编写,视频压缩用 VC++ 编写,并使用 pinvoke 或 CLI 调用此 VC++ dll。

I am looking for some one more experienced that me in this field who can suggest me if Iam going correct or can this be still improved.

我正在寻找一个在这个领域比我更有经验的人,他可以向我建议我是否正确,或者这是否仍然可以改进。

The ultimate goal is high quality video streaming. The codec can be any anything like h.2633, h.264 etc.

最终目标是高质量的视频流。编解码器可以是任何像 h.2633、h.264 等的东西。

采纳答案by Konstantin Salavatov

I've used several ways to get video streaming/conferencing with .net easily, without need to dig into directshow. (ok, dig some, but not deep :)

我使用了几种方法来轻松地通过 .net 获得视频流/会议,而无需深入研究 directshow。(好吧,挖一些,但不深:)

1) Use of plain Windows Media Encoder components. It is documented with samples in Windows Media Encoder SDK. Good for any high resolution streaming, but delay is too big for realtime chat (0.5-2 seconds at best). Modern Express Encoder SDK another option.

1) 使用普通的 Windows Media Encoder 组件。它通过 Windows Media Encoder SDK 中的示例进行了记录。适用于任何高分辨率流媒体,但延迟对于实时聊天来说太大了(最多 0.5-2 秒)。现代 Express Encoder SDK 的另一种选择。

2) Microsoft Research ConferenceXP http://cct.cs.washington.edu/Full featured conferencing API including application streaming. They too low level Windows Media coded filters and wrapped them into managed code. Works well. Easily customizable. Looks bit abandoned now.

2) Microsoft Research ConferenceXP http://cct.cs.washington.edu/全功能会议 API,包括应用程序流。他们太低级的 Windows Media 编码过滤器并将它们包装到托管代码中。效果很好。易于定制。现在看起来有点被遗弃了。

3) Microsoft RTC Client up to version 1.3 - core of windows messenger.

3) 微软 RTC 客户端 1.3 版——windows messenger 的核心。

pros: managed samples from Microsoft, good docs, reliable performance, freely redistributable, microsoft compatible (good) SIP stack included. Major conferencing vendors like Emblaze VCON based their solutions on it in some near past, not sure about this days, but I know that Tandberg licensed Microsft's VC-1.

优点:来自 Microsoft 的托管样本、良好的文档、可靠的性能、可自由再分发、与 Microsoft 兼容(良好)的 SIP 堆栈。像 Emblaze VCON 这样的主要会议供应商在不久的过去就基于它的解决方案,现在不确定,但我知道 Tandberg 获得了 Microsft 的 VC-1 的许可。

cons: version up to 1.3 support h261-h263 video only. modern version with support of VC-1(h264) codec does not allow direct serverless ip-ip connections. It does at require Microsoft Live Communications server. Newer version SDK does not cover well video conferencing calls.

缺点:1.3 以下版本仅支持 h261-h263 视频。支持 VC-1(h264) 编解码器的现代版本不允许直接无服务器 ip-ip 连接。它确实需要 Microsoft Live Communications 服务器。较新版本的 SDK 不能很好地覆盖视频会议呼叫。

http://msdn.microsoft.com/en-us/library/ms775892(VS.85).aspx

http://msdn.microsoft.com/en-us/library/ms775892(VS.85).aspx

Please let us know what platform you have chosen. By the way, I've even used ConferenceXP video rtp part with RTC 1.3 voice/SIP features together to improve video quality, so you have wide choice of managed technologies here. Another thing is Live Meeting at which I had no chance to take good look yet.

请告诉我们您选择了哪个平台。顺便说一下,我什至将 ConferenceXP 视频 rtp 部分与 RTC 1.3 语音/SIP 功能一起使用来提高视频质量,因此您可以在这里选择多种托管技术。另一件事是Live Meeting,我还没有机会好好看看。

回答by Chris Holmes

Save yourself the trouble and use VLC. There are some decent .NET wrappers for it (http://forum.videolan.org/viewtopic.php?f=32&t=52021&start=30)

省去麻烦并使用 VLC。有一些不错的 .NET 包装器(http://forum.videolan.org/viewtopic.php?f=32&t=52021&start=30

We are using C# and VLC for an IPTV network. We take input off DISH network satellites via Osprey-450 video capture devices on a Windows XP server. From there, we have a .NET server component that we wrote in C# that uses VLC behind the scenes (starting separate processes in .NET to control the vlc.exe instances). The VLC processes transcode and stream the signals over a network (.h264 or MPEG-4, we've successfully done both).

我们将 C# 和 VLC 用于 IPTV 网络。我们通过 Windows XP 服务器上的 Osprey-450 视频捕获设备从 DISH 网络卫星获取输入。从那里,我们有一个用 C# 编写的 .NET 服务器组件,它在后台使用 VLC(在 .NET 中启动单独的进程来控制 vlc.exe 实例)。VLC 处理转码并通过网络传输信号(.h264 或 MPEG-4,我们已经成功地完成了这两项工作)。

On the client side we have a C# WinForm application that uses an embedded VLC Viewer to view multicast signals. This application is mainly for command & control. The real use of the multicast signals happens when our set top boxes attached to our TV's decode and display the streams.

在客户端,我们有一个 C# WinForm 应用程序,它使用嵌入式 VLC 查看器来查看多播信号。此应用程序主要用于命令和控制。多播信号的真正使用发生在我们的机顶盒连接到我们的电视解码和显示流时。

We thought we were going to have to write our own DirectX encoders too, but don't go to all the trouble. VLC works really well and has enough C# support to be very useful. Feel free to e-mail me if you have specific questions about implementation.

我们认为我们也将不得不编写我们自己的 DirectX 编码器,但不要太麻烦。VLC 工作得非常好,并且有足够的 C# 支持,非常有用。如果您有关于实施的具体问题,请随时给我发电子邮件。

回答by Francis

You should check out the Ucentrik SDK. This SDK will enable you to integrate rich-media functionality such as video, audio, chat, remote-desktop sharing and control and video recording in your applications. The video codecs supported are VP8 (Google), Theora, and x.264. Additionally, the rich media traffic is encapsulated within an HTTP protocol to enable it to traverse firewalls that enable normal web traffic. This technology is completely free and you can download the SDK and request an API key so that you can evaluate without investing any time on setting up the infrastructure. In the next few months, we are releasing a server component so that you can download and host the infrastructure your self or your customer. The technology supports 1-to-many connections which means that you can create video conferences if you like. The features are highly modular so that you can integrate just the video or audio or desktop share or a combination of the technologies using the same SDK... You should request for an SDK available here: www.ucentrik.com. Additionally, there are some video's here: http://www.youtube.com/user/ucentrik

您应该查看 Ucentrik SDK。该 SDK 将使您能够在您的应用程序中集成丰富的媒体功能,例如视频、音频、聊天、远程桌面共享和控制以及视频录制。支持的视频编解码器是 VP8 (Google)、Theora 和 x.264。此外,富媒体流量封装在 HTTP 协议中,使其能够穿越防火墙,从而实现正常的 Web 流量。这项技术是完全免费的,您可以下载 SDK 并请求一个 API 密钥,这样您就可以进行评估,而无需花费任何时间来设置基础设施。在接下来的几个月中,我们将发布一个服务器组件,以便您可以下载和托管您自己或您的客户的基础设施。该技术支持一对多连接,这意味着您可以根据需要创建视频会议。这些功能是高度模块化的,因此您可以使用相同的 SDK 仅集成视频或音频或桌面共享或技术的组合...您应该在此处申请 SDK:www.ucentrik.com。此外,这里还有一些视频: http://www.youtube.com/user/ucentrik

good luck.

祝你好运。

回答by user1193676

Ucentrik has just released an open-source call-center application that integrates the CTX technology. This call-center application implements the video, audio, desktop/application sharing (with control), text chat functionality available from the CTX API. The application also includes some business logic specifically around providing the ability to route the calls to an agent that is available or have specific skill-set. The project is available at http://vcca.codeplex.com- please note that you will require access to the Ucentrik CTX SDK which is available for request on the Ucentrik website (www.ucentrik.com). Good luck.

Ucentrik 刚刚发布了一个集成了 CTX 技术的开源呼叫中心应用程序。此呼叫中心应用程序实现了 CTX API 提供的视频、音频、桌面/应用程序共享(带控制)、文本聊天功能。该应用程序还包括一些专门围绕提供将呼叫路由到可用或具有特定技能的代理的能力的业务逻辑。该项目可从http://vcca.codeplex.com 获得- 请注意,您需要访问 Ucentrik CTX SDK,可在 Ucentrik 网站 (www.ucentrik.com) 上索取该 SDK。祝你好运。