Ask Your Question
0

(Opencv 3.4.1)Reading video frame failed ,with error: Assertion failed (chunk.m_size <= 0xFFFF) in readFrame

asked 2018-04-09 22:26:57 -0600

I used same code and the same video and tested on the two environment.At first I tested on the "Opencv3.1.0 + windows(ubuntu) + VS2015",there is no error.But when I use the "opencv3.4.1+ MacOS + Cloin", I got the error:

  Unexpected list type. Expected: hdrl. Got: movi.
  OpenCV(3.4.1) Error: Assertion failed (chunk.m_size <= 0xFFFF) in readFrame, file /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/videoio/src/container_avi.cpp, line 514
  libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.1) /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/videoio/src/container_avi.cpp:514: error: (-215) chunk.m_size <= 0xFFFF in function readFrame

Test code :

VideoCapture cap("test.avi");
if(!cap.isOpened())
{
    cout << "error" << endl;
    return -1;
}
Mat img;
double rate = cap.get(CV_CAP_PROP_FPS);
cout << rate << endl;
int total_rate = cap.get(CV_CAP_PROP_FRAME_COUNT);
cout << total_rate << endl;
while (true) {
    if(!cap.read(img)) break;
}

Is there anyway to solve the problem,thanks?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-08-24 06:18:39 -0600

This is a bug in OpenCV 3.4.1 (see https://github.com/opencv/opencv/issu...). You can probably use a different OpenCV version.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-04-09 22:26:57 -0600

Seen: 2,830 times

Last updated: Apr 09 '18