wpf 使用 C# 64 位的 Axis 摄像机视频流

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13481034/
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-09-13 06:18:31  来源:igfitidea点击:

Axis Camera video streaming with C# 64bit

c#wpfdirectshowrtspms-media-foundation

提问by J.L

I'm looking for a way to stream video from an AXIS M10 IP camera, and display the feed using windows forms (or better, wpf). However, it need to be running on 64-bitplatform.

我正在寻找一种方法来从 AXIS M10 IP 摄像机流式传输视频,并使用 Windows 窗体(或更好的 wpf)显示提要。但是,它需要在64 位平台上运行。

This means that I can't use the AXIS Media Control ActiveX component. Also, I found that these methods work but only in 32bit environment:

这意味着我无法使用 AXIS Media Control ActiveX 组件。此外,我发现这些方法有效,但仅适用于 32 位环境:

1.Using MediaElement Class for WPF

1.为 WPF 使用 MediaElement 类

2.Using embedded media player

2.使用嵌入式媒体播放器

3.VlcLib (for dotnet)

3.VlcLib(用于dotnet

So far it looks like my only option is to directly implement RTSP protocol and decode the given RTP/AVP stream using Media Foundation (for .net) and display it somehow. (I was able to get the camera to stream to a UDP port using RTSP calls).

到目前为止,看起来我唯一的选择是直接实现 RTSP 协议并使用 Media Foundation(用于 .net)解码给定的 RTP/AVP 流并以某种方式显示它。(我能够使用 RTSP 调用让相机流式传输到 UDP 端口)。

I'm fairly new to RTSP/streaming, so I'm concerned that I might be missing the big picture - Will I be able to use media foundation to render/display videos on winform/wpf, or do I have to look at that functionality elsewhere?(from my research it looked like it could decode H.264 streams, but I did not see any video-playing capabilities). I also came across DirectShow - should I use DirectShow over Media Foundation?

我对 RTSP/流媒体相当陌生,所以我担心我可能会错过大局 - 我是否能够使用媒体基础在 winform/wpf 上渲染/显示视频,或者我必须看看那个其他地方的功能?(根据我的研究,它看起来可以解码 H.264 流,但我没有看到任何视频播放功能)。我还遇到了 DirectShow - 我应该在 Media Foundation 上使用 DirectShow 吗?

Or better yet, is there a library that is able to handle RTSP streaming that runs in 64bit?

或者更好的是,是否有能够处理 64 位运行的 RTSP 流的库?

回答by roman.minyaylov

VisioForge Video Capture SDK .Netfor example (but commercial), WPF controls included. Decoding using FFMPEG, with DirectShow engine. Really, I don't see any Media Foundation advantages here.

例如VisioForge Video Capture SDK .Net(但商业),包括 WPF 控件。使用 FFMPEG 解码,使用 DirectShow 引擎。真的,我在这里看不到任何媒体基金会的优势。

Also any other way using FFMPEG.

也可以使用 FFMPEG 的任何其他方式。

Or, you can write RTSP source filter (based on DirectShow Push Source sample) with H264 output pin for video and G726/G711/AAC for audio. Also you can made virtual video capture source filter and use it in MF or DirectShow. You can use live555library for RTSP implementation.

或者,您可以使用 H264 视频输出引脚和音频 G726/G711/AAC 编写 RTSP 源过滤器(基于 DirectShow Push Source 示例)。您也可以制作虚拟视频捕获源过滤器并在 MF 或 DirectShow 中使用它。您可以使用live555库进行 RTSP 实现。

So, no simple ways here, if you are starting from zero.

所以,如果你从零开始,这里没有简单的方法。

回答by CPlusSharp

If you just need the Video, I would prefer to just display the MJPEG stream of the camera. This is really easy done without the complexity of DirectShow or MediaFoundation. I display 12 cameras at the same time in my application with this little library in WPF: MJPEG Decoder. You can also use it in WinForms. It decodes the MJPEG Stream and gives you the images to display.

如果您只需要视频,我宁愿只显示相机的 MJPEG 流。这真的很容易完成,没有 DirectShow 或 MediaFoundation 的复杂性。我使用 WPF 中的这个小库在我的应用程序中同时显示 12 个摄像头:MJPEG Decoder。您也可以在 WinForms 中使用它。它解码 MJPEG 流并为您提供要显示的图像。

回答by Larry

The 64 bits Axis Media Control SDK is available now, but requires an account on Axis web site to be downloaded.

64 位 Axis Media Control SDK 现在可用,但需要在 Axis 网站上下载帐户才能下载。