Ask Your Question

Unable to open mp4 video file with VideoCapture before and after recompiling with ffmpeg

asked 2015-08-18 16:15:21 -0500

ricardo_8990 gravatar image

It all started when I tried to run a program like this:

VideoCapture cap;"GOPR3252.mp4");

    return -1;

I couldn't open the video, even though I tried to manually add the codec CV_FOURCC('A', 'V', 'C', '1'). I read that this may be due to the link with ffmpeg. So I compiled and installed ffmpeg using this guide and this one.

Later, I uninstalled OpenCV, downloaded and compiled using CMake as:


However, all the time I get this in the resume at the video section:

--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      NO
--       codec:                     NO
--       format:                    NO
--       util:                      NO
--       swscale:                   NO
--       resample:                  NO
--       gentoo-style:              NO
--     GStreamer:                   NO
--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     OpenNI2:                     NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     UniCap:                      NO
--     UniCap ucil:                 NO
--     V4L/V4L2:                    NO/YES
--     XIMEA:                       NO
--     Xine:                        NO
--     gPhoto2:                     NO

I have no problem making and installing OpenCV, but I still can't open that video.

Then, I tried to convert the video from mp4 to avi and got this error when reading the video file:

Unexpected list type. Expected: hdrl. Got: movi.

I am running out of ideas. Any clue what I am doing wrong?

I am using OpenSUSE 13.2

Thanks in advance,

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-12-13 10:57:17 -0500

Delauney gravatar image

I think you have to have mp4 codec installed in your OS. Make sure your environment can open/understand MP4 before OpenCV can understand it.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-08-18 16:10:00 -0500

Seen: 7,570 times

Last updated: Dec 13 '15