Capturing UDP multicast video stream using OpenCV

I have a multi-threaded UDP video stream for which I need an OPENCV (Emgu) 2.4.x application for capture and processing ("client").

On the client, I can capture the stream using VLC (udp: //xx.yy.zz.aaa: 1234). However, my application cannot capture this udp stream. My code is pretty simple (

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

ps I tried with and 2 / o @ also tried rtp at this address. Bad luck: -/

Does OpenCV allow "capture" of UDP streams? or do I need to run VLC on the client in order to retransmit the video as rtp or http or some other.?

Thanks.

+2
source share
2 answers

I finally understood this and shared in the hope that it could help others,

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

don't forget the @ symbol!

the capture is successfully created in the UDP stream, however access to the properties of the capture causes it to be thrown and causes an error.

In short, the UDP stream does not pass device property streams, so you may need to get it elsewhere or encode it.

On the other hand, since FPS (frames per second) is unreliable, if not erroneous, you may need to configure FPS, especially if you are polling a stream in a loop.

NTN

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

This will also complete the task if you do not have video integration libraries.

0
source

Source: https://habr.com/ru/post/1260941/


All Articles