Capturing a Multicast UDP Video stream using OpenCV

我怕爱的太早我们不能终老 提交于 2019-12-01 11:25:54

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

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

don't forget the @ symbol!

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

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.

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

IplImage* frame;
CvCapture* pCapture;
pCapture = cvCaptureFromFile("udp://ip:port/path");
frame = cvQueryFrame(pCapture);

This will also do the job in case you don't have videoInput libraries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!