Ask Your Question

Vadim Kantorov's profile - activity

2016-03-16 03:41:15 -0600 received badge  Student (source)
2015-08-12 09:21:08 -0600 commented question Read video with VideoCapture in OpenCV 2.4.11

877677894 corresponds to FMP4

assert(in.isOpened()) check passes fine.

I build the example with this:

g++ bug.cpp -o bug -O3 -D__STDC_CONSTANT_MACROS -lopencv_videoio -lopencv_imgproc -lopencv_imgcodecs -lopencv_core -lopencv_hal -lpng -ldl -lswscale -lavdevice -lavformat -lavcodec -lswresample -lavutil -lpthread -lbz2 -lz -lc -lrt -Iinclude -Llib

The linking is done statically, the resulting binary has no OpenCV/ffmpeg shared lib dependencies.

2015-08-12 09:20:04 -0600 commented question Read video with VideoCapture in OpenCV 2.4.11

When I compile this:

#include <cassert>
#include <cstdio>
#include <opencv2/videoio/videoio.hpp>

int main()
{
    cv::VideoCapture in("mpi_sintel_final_alley_1.avi");
    cv::Mat_<char> frame;
    assert(in.isOpened());

    int fourcc = in.get(cv::CAP_PROP_FOURCC);
    printf("%d\n", fourcc);

    assert(in.read(frame));
}

with OpenCV 3.0.0 (built with this script: http://pastebin.com/sdzH7udG), I get this:

877677894
OpenCV Error: Bad argument (Unknown array type) in cvarrToMat, file /.../modules/core/src/matrix.cpp, line 880
terminate called after throwing an instance of 'cv::Exception'
  what():  /.../modules/coresrc/matrix.cpp:880: error: (-5) Unknown array type in function cvarrToMat

Aborted
2015-08-10 11:16:21 -0600 commented question Read video with VideoCapture in OpenCV 2.4.11

I am running this example on Linux. I install FFmpeg and OpenCV as follows: http://pastebin.com/LP1VzRSJ

2015-08-10 08:33:38 -0600 asked a question Read video with VideoCapture in OpenCV 2.4.11

Hi,

I am trying to read a video:

#include <cassert>
#include <opencv2/highgui/highgui.hpp>

int main()
{
    cv::VideoCapture in("mpi_sintel_final_alley_1.avi");
    cv::Mat frame;
    assert(in.isOpened());
    assert(in.read(frame));
}

The second assertion fails. I've tried some other videos as well, it doesn't work either. I uploaded this video to my GitHub repo: https://raw.githubusercontent.com/vad...

The version of OpenCV is 2.4.11 and it is compiled with FFmpeg 2.7.2.

What am I missing?

Thank you, Vadim