Java OpenCv VideoWriter不会打开OpenCv 4.4.0。

huangapple go评论84阅读模式
英文:

Java OpenCv VideoWriter wont open OpenCv 4.4.0

问题

public void save(String filename) {
    Size size = new Size(this.shape[0], this.shape[1]);
    VideoWriter videoWriter = new VideoWriter(filename, 0, this.fps, size, true);
    System.out.println(videoWriter.open(filename, 0, this.fps, size, true));
    for (Mat frame : this.frames) {
        videoWriter.write(frame);
    }
    videoWriter.release();
}
Im using java jdk 14.0.2, OpenCv 4.4.0 and Intellij
Im trying to combine the frames in the ArrayList this.frames.
When i check if videoWriter is open it returns false.
Iv'e tried OpenCv 3.4.0 which managed to create a file but not write to it.
英文:
public void save(String filename){
    Size size = new Size(this.shape[0], this.shape[1]);
    VideoWriter videoWriter = new VideoWriter(filename, 0, this.fps , size, true);
    System.out.println(videoWriter.open(filename, 0, this.fps , size, true));
    for(Mat frame : this.frames) {
        videoWriter.write(frame);
    }
    videoWriter.release();
}

Im using java jdk 14.0.2, OpenCv 4.4.0 and Intellij
Im trying to combine the frames in the ArrayList this.frames.
When i check if videoWriter is open it returns false.
Iv'e tried OpenCv 3.4.0 which managed to create a file but not write to it.

答案1

得分: 1

将在OpenCV zip文件的bin文件夹中找到的ffmpeg dll移动到opencv_440.dll的位置。

英文:

Moving the ffmpeg dll found in the bin folder of the opencv zip to the location of the opencv_440.dll.

huangapple
  • 本文由 发表于 2020年8月7日 05:07:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/63291768.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定