Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Java OpenCV/JavaCV - Unable to read UDP video content

I have a device that sends live video from a scene camera. The video is encoded into the h.264 compression format. The audio from is encoded into the mp3 compressions format. It is transmitted via UDP as mpeg-ts (MPEG transport stream) packets (188 bytes each).

I am able to vie the content by opening the following addess with VLC udp://@192.168.1.137:13007

However, I am unable to read that content with OpenCV using these lines

VideoCapture camera = new VideoCapture();
camera.open("udp://@192.168.1.137:13007");

Mat frame = new Mat();
camera.read(frame);

Using the grab funtion with these lines:

boolean grab = false;
grab = camera.grab();

The grab variable remains false.

With JavaCV, I have the following lines:

FFmpegFrameGrabber grabber = new FFmpegFrameGrabber("udp://@192.168.1.137:13007");
grabber.start();

and I get the following error

null: InvocationTargetException: Could not initialize class org.bytedeco.javacpp.avutil

Thanks in advance