使用 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");
附言我已经尝试过 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
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcfggbe
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20