如何使用 C# 流式传输网络摄像头视频? [英] How can I stream webcam video with C#?

查看:45
本文介绍了如何使用 C# 流式传输网络摄像头视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个简单的服务器应用程序,人们可以在其中使用基于浏览器的客户端(我稍后会制作)进行连接以观看流媒体视频.我想使用 C#.

I want to make a simple server application where people can connect using a browser-based client (which I will make later) to watch streaming video. And I want to use C#.

通过网络摄像头捕捉视频或快速图像并通过网络发送它们需要什么?

What do I need to capture video or rapid images through a webcam and send them over the network?

推荐答案

如果您想要一个盒子中的捕获/流媒体"组件,正如其他人提到的那样,有几个组件.

If you want a "capture/streamer in a box" component, there are several out there as others have mentioned.

如果你想深入到底层控制这一切,你需要使用 DirectShow,正如 thealliedhacker 指出的那样.在 C# 中使用 DirectShow 的最佳方法是通过 DirectShow.Net 库 - 它封装了所有 DirectShow COMAPI 并包含许多有用的快捷功能.

If you want to get down to the low-level control over it all, you'll need to use DirectShow as thealliedhacker points out. The best way to use DirectShow in C# is through the DirectShow.Net library - it wraps all of the DirectShow COM APIs and includes many useful shortcut functions for you.

除了捕获和流式传输之外,您还可以进行录制、音频和视频格式转换、音频和视频直播过滤器等等.

In addition to capturing and streaming, you can also do recording, audio and video format conversions, audio and video live filters, and a whole lot of stuff.

微软声称 DirectShow 将消失,但他们还没有发布一个新的库或 API 来完成 DirectShow 提供的所有功能.我怀疑他们发布的许多最新内容仍然是 DirectShow.由于它在 Microsoft 的地位,除了 MSDN 和您可以在论坛上找到的内容之外,没有太多关于它的书籍或参考资料.去年我们开始使用它的项目时,关于这个主题的最好的书 - Microsoft DirectShow 编程 - 已绝版,旧版售价约 350 美元!

Microsoft claims DirectShow is going away, but they have yet to release a new library or API that does everything that DirectShow provides. I suspect many of the latest things they have released are still DirectShow under the hood. Because of its status at Microsoft, there aren't a whole lot of books or references on it other than MSDN and what you can find on forums. Last year when we started a project using it, the best book on the subject - Programming Microsoft DirectShow - was out of print and going for around $350 for a used copy!

这篇关于如何使用 C# 流式传输网络摄像头视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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