Opencv 3.2 video file not opening

asked 2017-10-03 12:26:43 -0600

Aritra gravatar image

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
edit retag flag offensive close merge delete

Comments

Same problem opencv3.3.0 on Windows no errors, but capture.isOpened() == false

dark4eg gravatar imagedark4eg ( 2017-10-09 10:35:47 -0600 )edit