Capture stops after some (18 in my case) frames Java and Python

asked 2016-01-04 08:10:28 -0600

OS : Windows 10 x64 Software : Opencv 3.1.0 Java : Java 8 Update 66 (64-bit) Oracle Corporation 11/27/2015 203 MB 8.0.660.18 Python : Python 3.5.1 (64-bit) Python Software Foundation 12/15/2015 86.3 MB 3.5.1150.0

Description : In my python and Java code, I open an MP4 file for capture. After 18 frames the capture stops in both Python 3.5.1 x64 and Java 8 (same code in principle)

The problem is the grab(). The series of frames I get if I comment out grab and use

        double elapsed_time = vc.get(org.opencv.videoio.Videoio.CAP_PROP_POS_MSEC);
        this.seqNumber = (int) vc.get(org.opencv.videoio.Videoio.CAP_PROP_POS_FRAMES);

        long time_pos = this.current_time.getTime() + (long) elapsed_time;
        this.current_time = new Date(time_pos);

        System.out.println(this.video_file);
        System.out.println(this.seqNumber);
        System.out.println(this.current_time.getTime());

is the following print out

c:/workspace/seconvideo/cam1/GOPR0158.MP4 1 1448287109033 c:/workspace/seconvideo/cam1/GOPR0158.MP4 2 1448287109099 c:/workspace/seconvideo/cam1/GOPR0158.MP4 3 1448287109199 c:/workspace/seconvideo/cam1/GOPR0158.MP4 4 1448287109332 c:/workspace/seconvideo/cam1/GOPR0158.MP4 5 1448287109498 c:/workspace/seconvideo/cam1/GOPR0158.MP4 6 1448287109698 c:/workspace/seconvideo/cam1/GOPR0158.MP4 7 1448287109931 c:/workspace/seconvideo/cam1/GOPR0158.MP4 8 1448287110197 c:/workspace/seconvideo/cam1/GOPR0158.MP4 9 1448287110497 c:/workspace/seconvideo/cam1/GOPR0158.MP4 10 1448287110830 c:/workspace/seconvideo/cam1/GOPR0158.MP4 11 1448287111197 c:/workspace/seconvideo/cam1/GOPR0158.MP4 12 1448287111597 c:/workspace/seconvideo/cam1/GOPR0158.MP4 13 1448287112030 c:/workspace/seconvideo/cam1/GOPR0158.MP4 14 1448287112497 c:/workspace/seconvideo/cam1/GOPR0158.MP4 15 1448287112997 c:/workspace/seconvideo/cam1/GOPR0158.MP4 16 1448287113530 c:/workspace/seconvideo/cam1/GOPR0158.MP4 17 1448287114097 c:/workspace/seconvideo/cam1/GOPR0158.MP4 18 1448287114697 c:/workspace/seconvideo/cam1/GOPR0158.MP4 18 1448287115297 c:/workspace/seconvideo/cam1/GOPR0158.MP4 18 1448287115897 c:/workspace/seconvideo/cam1/GOPR0158.MP4 18 1448287116497 c:/workspace/seconvideo/cam1/GOPR0158.MP4 18 1448287117097 c:/workspace/seconvideo/cam1/GOPR0158.MP4 18 1448287117697 c:/workspace/seconvideo/cam1/GOPR0158.MP4 18 1448287118297 c:/workspace/seconvideo/cam1/GOPR0158.MP4 18 1448287118897 c:/workspace/seconvideo/cam1/GOPR0158.MP4 18 1448287119497

edit retag flag offensive close merge delete