Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Java use the OpenCV library bound by JavaCPP for CUDA-accelerated decoding of RTSP streams #1478

Open
sulv9999 opened this issue Feb 27, 2024 · 1 comment

Comments

@sulv9999
Copy link

Can Java use the OpenCV library bound by JavaCPP for CUDA-accelerated decoding of RTSP streams
I have not succeeded.
I can confirm that the RTSP stream address I am using is correct, and I am able to open it using VLC.

package org.example;
import org.bytedeco.opencv.opencv_core.GpuMat;
import org.bytedeco.opencv.opencv_core.Mat;
import org.bytedeco.opencv.opencv_videoio.VideoCapture;
public class Main {
public static void main(String[] args) {
VideoCapture videoCapture = new VideoCapture("rtsp://admin:abcd1234@192.168.2.101:554/h265/ch1/main/video");
if (videoCapture.isOpened()) {
System.out.println(1);
}
GpuMat gpuMat = new GpuMat();
Mat mat = new Mat();
if (videoCapture.read(gpuMat)) {
gpuMat.upload(mat);
}
}
}

ERROR:0@0.320] global cap.cpp:164 open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.7.0) /__w/javacpp-presets/javacpp-presets/opencv/cppbuild/linux-x86_64/opencv-4.7.0/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): rtsp://admin:abcd1234@192.168.2.101:554/h265/ch1/main/video in function 'icvExtractPattern'

Exception in thread "main" java.lang.RuntimeException: OpenCV(4.7.0) /__w/javacpp-presets/javacpp-presets/opencv/cppbuild/linux-x86_64/opencv-4.7.0/modules/core/src/matrix_wrap.cpp:1689: error: (-213:The function/feature is not implemented) CUDA support is not enabled in this OpenCV build (missing HAVE_CUDA) in function 'release'

at org.bytedeco.opencv.opencv_videoio.VideoCapture.read(Native Method)
at org.example.Main.main(Main.java:23)
@saudet
Copy link
Member

saudet commented Feb 27, 2024

Please use FFmpegFrameGrabber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants