April 7th, 2010, 09:22 AM
How to open video files with various codecs and files extensions?
I'm rather new to OpenCV, and I have this simple code to play a video clip:
But, it only plays SOME codecs and file extentions (such as MJPG and DivX codecs of .avi file). What should I do to be able to play other types of files. I've wasted many hours on it, and I couldn't find a way. I'll appreciate any type of help! (should I install some codecs, or use a *.dll or #include something? how?) (I can play them with media player but not with my code.)
cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );
CvCapture* capture = cvCreateFileCapture( argv );
frame = cvQueryFrame( capture );
if( !frame ) break;
cvShowImage( "Example2", frame );
char c = cvWaitKey(33);
if( c == 27 ) break;
cvReleaseCapture( &capture );
cvDestroyWindow( "Example2" );
p.s.: I need to open these filetypes: avi (DivX, Xvid, uncompressed), flv, wmv, mpg.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.