Ask Your Question

Revision history [back]

Opencv 3.2 video file not opening

I am using Opencv 3.2.0 in Ubuntu 17.04(Budge). I am simply trying to count frame number of a video file. But video file isn't even opening!! I have kept my video file in my project folder.

System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
        VideoCapture capture = new VideoCapture("/home/aritra/workspace/oopencv/horror.mp4");

        if(!capture.isOpened()){
            System.out.println("could not open this file ");
        }
        else{
            System.out.println("lingth"+(capture.get(Videoio.CAP_PROP_FRAME_COUNT)));
        }

When I run this it is showing messege like this

(DEBUG) try_init_v4l2 VIDIOC_QUERYCAP "/home/aritra/workspace/oopencv/horror.mp4": Inappropriate ioctl for device
Unable to stop the stream: Inappropriate ioctl for device
could not open this file