• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

使用 OpenCV 捕获多播 UDP 视频流

用户头像
it1352
帮助1

问题说明

我有一个多播 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");

附言我已经尝试过 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....?

谢谢.

正确答案

#1

我终于想通了,分享一下,希望对大家有所帮助,

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

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcfggbe
系列文章
更多 icon
同类精品
更多 icon
继续加载