bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.45k stars 1.57k forks source link

There were errors using Centos7, but Windows 10 works well. #2031

Closed yxjavac closed 1 year ago

yxjavac commented 1 year ago

The following error was encountered on the Centos7 system:

1684926608271

my code is,please help me:

public static void screenshot(String rtspUrl, String fileName) throws IOException {
        FFmpegFrameGrabber grabber = FFmpegFrameGrabber.createDefault(rtspUrl);
        grabber.setOption("rtsp_transport", "tcp");
        grabber.setImageWidth(1920);
        grabber.setImageHeight(1080);
        grabber.setFormat("rtsp");
        grabber.start();
        File outPut = new File(fileName);
        while (true) {
            Frame frame = grabber.grabImage();
            if (frame != null) {
                ImageIO.write(frameToBufferedImage(frame), "jpg", outPut);
                grabber.stop();
                grabber.release();
                break;
            }
        }
}
yxjavac commented 1 year ago

It should be a system issue. After replacing the server, it ran very well