VideoWriter VideoCapture and uncompressed AVI
Hi everyone,
I think a similar issue is reported in a previous unanswered discussion. But I prefer to report my issue with more details. Anyway, I have a problem with cv::VideoCapture when grabbing frames from an uncompressed AVI file created using cv::VideoWriter. Basically the video seems ok when it's played with WMP for instance, but the frames are corrupted when grabbed using cv::VideoCapture (a snapshot here).
I'm using OpenCV 2.4.1, built in Windows 7 using Visual Studio 2010, x86, WITH_VIDEOINPUT=ON and WITH_FFMPEG=OFF. Here's a quick code sample:
int main()
{
VideoCapture camera(0);
VideoWriter writer("test.avi", 0, 30.0, Size(640, 480), true);
int count = 0;
while (count++ < 90)
{
Mat frm;
camera >> frm;
writer << frm;
imshow("Frame recorded", frm);
waitKey(1);
}
camera.release();
writer.release();
VideoCapture video("test.avi");
Mat frm;
while (video.read(frm))
{
imshow("Frame grabbed", frm);
waitKey();
}
return 0;
}
I checked the issue tracker, and the change-log of the latest version, but this problems seems not to be mentioned. So, I suppose I'm missing something. Any help is appreciated! Thanks in advance,
Giuliano
I have the same problem.
It seems no one has an easy solution. It's an annoying problem. At least I would like to understand if it's a common problem or if it depends on the specific OpenCV configuration.
Same problem but no solution, for me it should be a bug.
Unfortunately a longstanding bug http://code.opencv.org/issues/2281
rbiro, the link you posted seems to report a different issue. I having the same problem as reported here, when I try to read an uncompressed AVI (DIB ) fourCC. I don't see the crash reported in the previous link. They claim they just fixed the issue by updating ffmpeg to the latest version, but I don't see why. From my initial debugging, this has nothing to do with FFMpeg and the bug seems to be in cap_vfw.cpp. I don't see how updating ffmpeg can fix the issue as I see the bug when using the Windows API code path. Do you agree? Thanks.