我需要构建一个非常简单的流服务器。它需要能够从设备捕获视频,然后通过多播将该视频流式传输到 LAN 上的多个客户端。
由于有人用 DirectShow.Net ( http://www.codeproject.com/KB/directx/directxcapture.aspx )编写的库,这部分的捕获非常容易(在 C# 中)。
我现在的问题是如何多播这个?这是我坚持的部分。我不确定下一步该做什么,或采取什么步骤。
我需要构建一个非常简单的流服务器。它需要能够从设备捕获视频,然后通过多播将该视频流式传输到 LAN 上的多个客户端。
由于有人用 DirectShow.Net ( http://www.codeproject.com/KB/directx/directxcapture.aspx )编写的库,这部分的捕获非常容易(在 C# 中)。
我现在的问题是如何多播这个?这是我坚持的部分。我不确定下一步该做什么,或采取什么步骤。
没有可以插入和使用的过滤器。
你需要在这里做三件事:
第 1 部分有很多可用的编解码器,有些设备甚至可以输出压缩视频。
第 3 部分也很简单。
主要问题与第 2 部分有关,因为 MPEG 传输流已获得专利。它已获得许可,因此您无法基于它开发自由软件(VLC 和 FFMPEG 违反了该许可),并且您必须支付数百美元才能获得一份规范副本。
如果你必须开发它,你需要:
它必须是渲染器,因为传输流不是转换过滤器。有一些带外数据(程序分配表和参考时钟)需要定期发送,您需要保留一个工作线程来执行此操作。
To achieve that you need to setup/write some kind of video streaming server.
I've used VideoCapX for the same purpose on my project. The documentation and support is not top notch, but it's good enough. It's using WMV streaming technology. The stream is called MMS stream. You can view it with any most media player. I've tested with Windows Media Player, Media Player Classics and VLC. If you would like to see it's capability without writing any code just yet, take a look at U-Broadcast, it uses VideoCapX to do the job behind the scene.
I've been using DirectShow.Net for almost 2 years, and I still find it hard to write a streaming server myself, due to the complexity of DirectShow technology.
Other than WMV, you can take a look at Helix Server or Apple Streaming Server. The latter one is not free, so is WMV Streaming Server from Microsoft.
You can also take a look at VLC or Windows Media Encoder to do streaming straight from the application. But so far I find U-Broadcast out do both of the above. VLC has some compatibility issue with codec and playback from non VLC player, WME has problem with starting up capturing device.
Good Luck
NOTE: I'm not associated with VideoCapX or it's company, I'm just a happy user of it.
http://www.codeproject.com/KB/directx/DShowStreamingServer.aspx可能会有所帮助,http ://en.wikipedia.org/wiki/VLC_media_player#cite_note-14
VLC 还“应该”能够从任何设备本地流式传输。