Ask Your Question

Displaying UDP Multicast Stream

asked 2020-03-23 16:44:10 -0500

otoker gravatar image

Hi, I'm trying to display a multicast UDP video stream using OpenCV (4.2.0) with Java. I can grab the webcam and any RTSP video;

VideoCapture videoDevice = new VideoCapture();;


but I couldn't join a udp stream. For testing, in the server side, I sent the webcam via FFmpeg;

ffmpeg.exe  -f dshow  -i video="USB2.0 HD UVC WebCam" -r 30 -f rawvideo udp://@

and I could display the video with ffplay;

ffplay.exe -f rawvideo -i  udp://@

but I could not join the stream with;"udp://@");

and I also tried videoDevice.grab() but nothings changed. What is wrong? Is there any other settings?


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-03-28 05:49:53 -0500

otoker gravatar image

I just want to update the situation;

I stream the webcam with FFmpeg (command line) via UDP as above. On the client side I use Java OpenCV, the capture line;"udp://xx.xx.xx.xx:xx). If I sent the stream as mpegts (ffmpeg -f mpegts), I can display the stream but; if I sent it as rawvideo (ffmpeg -f rawvideo), I couldn't.

Is there any parameter to set (like CvType) ?

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-03-23 16:44:10 -0500

Seen: 445 times

Last updated: Mar 28 '20