open video file with opencv java

前端 未结 4 817
北荒
北荒 2020-12-31 22:29

so there is OpenCV for Java now...! Can anyone tell me how to open Videofiles with it ?

I tryed and look all over the internet, but found nothing. The documentation

4条回答
  •  甜味超标
    2020-12-31 23:08

    Here is how it worked for me.

    VideoCapture capture=new VideoCapture();
    capture.open("Vid.mp4");
    Mat frame=new Mat();
                
       
    for(;;){
       capture.read(frame); //reads captured frame into the Mat image
       imshow("Display",frame);
       if(cvWaitKey(30) >= 0) break;
    }

提交回复
热议问题