Ask Your Question

ipunus's profile - activity

2015-01-10 04:55:17 -0600 received badge  Enthusiast
2015-01-03 07:47:54 -0600 asked a question cvcapture avi (xvid) == NULL;

Dear all,

I tried to solve the following problem for a lot of day:

  • Target: I want to read a avi-file with xvid codec
  • Status: cvcapturefromavi doesn't work, give a NULL back

Operating system MacOS Yosemite, Xcode 6 (clean system)

First install opencv without ffmpeg support (downloaded,cmake and homebrew, tried both) Application crashed soon after starting, NULL for cvCaptureFromAVI

Then I tried with ffmpeg, so installed separate ffmpeg -with xvid -with ffplay with homebrew and also opencv with ffmpeg support -> Application crashed soon after starting, Error opening file (/tmp/opencv-uG3i8H/opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp:545) -> NULL for cvCaptureFromAVI

I can play the video-file with ffplay, no problem.

Can you pls help? I searched about two days in whole google...or in which codec I have to convert the file?

int main (int argc, const char* argv[])
{
CvCapture* video_in;
IplImage* frame_video_in;
video_in = cvCaptureFromAVI("video1.avi");

cvNamedWindow("Original", CV_WINDOW_AUTOSIZE);  


while (1) {


frame_video_in = cvQueryFrame(video_in);


cvShowImage("Original", frame_video_in);

}

cvDestroyAllWindows();
return 0;
}