Ask Your Question
0

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

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

ricardo_8990 gravatar image

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

VideoCapture cap;
cap.open("GOPR3252.mp4");

if(!cap.isOpened())
{
    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:

cmake -D CMAKE_SHARED_LINKER_FLAGS=-Wl,-Bsymbolic -D WITH_FFMPEG=ON -D WITH_QT=ON -D BUILD_EXAMPLES=ON CMAKE_BUILD_TYPE=Release /route_to_software/opencv/

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
0

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

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. http://opensuse-guide.org/codecs.php

edit flag offensive delete link more

Question Tools

1 follower

Stats

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

Seen: 9,999 times

Last updated: Dec 13 '15