- Project Architecture: spring boot, gradle
- Dependencies: org.bytedeco:opencv-platform:4.9.0-1.5.10
- Operating system: Mac 14.7, Ubuntu 22.04.5
Code:
File sourceFile = FileUtils.downloadWithRetry(videoProperties.getBaseDir(), fsFile.getRawUrl(), filesTbp.getName(), 3);
if (null == sourceFile) {
log.warn("download video file failed, parent:{}, name:{}", filesTbp.getParent(), filesTbp.getName());
return;
}
VideoCapture videoCapture = new VideoCapture(sourceFile.getAbsolutePath());
// check is open
if (!videoCapture.isOpened()) {
//boolean deleted = sourceFile.delete();
log.error("Could not open video file, parent:{}, name:{}, result:{}", filesTbp.getParent(), filesTbp.getName(), false);
return;
}
Issue: For the same video file, isOpened is true on Mac, but false on ubuntu. How to find the false of failure or solve on Ubuntu?
Attempts to open the OpenCV logs fail when using
@Slf4j
@Configuration
public class OpenCVConfig {
@PostConstruct
public void loadOpenCV() {
System.setProperty("OPENCV_LOG_LEVEL", "DEBUG");
// local OpenCV
Loader.load(org.bytedeco.opencv.opencv_java.class);
log.info("OpenCV loaded successfully");
}
}