使用OpenCV捕获多播UDP视频流 [英] Capturing a Multicast UDP Video stream using OpenCV

查看:643
本文介绍了使用OpenCV捕获多播UDP视频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多播UDP视频流,我需要我的OPenCV(Emgu)2.4.x应用程序来捕获和处理(客户端").

I have a multi-cast UDP Video stream that I need my OPenCV (Emgu ) 2.4.x app to capture and process ("client").

在客户端上,我可以使用VLC(udp://xx.yy.zz.aaa:1234捕获流,但是我的应用程序无法捕获此udp流.我的代码非常简单(

On the client, I can capture the stream using VLC (udp://xx.yy.zz.aaa:1234, However the my app fails to capture this udp stream. My code is quite simple (

Capture cap = new Capture ("udp://@212.1.1.1:1234");

p.s.我已经尝试过了,并且2/o @也尝试了该地址上的rtp.没有运气:-/

p.s. I have tried with and 2/o the @ also tried rtp on that address. No luck :-/

OpenCV是否直接允许捕获" UDP流?还是我需要在客户端上运行VLC才能将视频重新流化为rtp或http或其他....?

Does OpenCV directly allow "capture" of UDP streams? or do I need to run VLC on the client to re-stream the video as rtp or http or some other....?

谢谢.

推荐答案

我终于弄清楚了这一点,并与大家分享,希望对别人有帮助,

I finally figured this out and sharing in the hope that might help others,

Capture cap = new Capture ("udp://@212.1.1.1:1234");

别忘了@符号!

捕获已在UDP流上成功创建,但是访问捕获属性会导致捕获异常并导致错误.

the capture is successfully created on the UDP Stream, however accessing the capture properties causes it to exception out and causes the error.

长话短说,UDP流似乎并未流式传输设备属性,因此您可能需要在其他地方获取或编码.

Long story short, the UDP stream does not appear to stream the device properties so you might need to obtain that elsewhere or code it in.

另一方面,由于FPS(每秒帧数)不可靠,因此即使不是完全不正确,也可能需要使FPS可调,尤其是在循环轮询流的情况下.

On other thing of note, that since the FPS (frames per sec) is unreliable, if not outright incorrect, you might need to make the FPS adjustable, especially if you are polling the stream in a loop.

HTH

这篇关于使用OpenCV捕获多播UDP视频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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