-
April 7th, 2010, 09:22 AM
#1
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:
Code:
#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
.
.
.
cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );
CvCapture* capture = cvCreateFileCapture( argv );
IplImage* frame;
while(1)
{
frame = cvQueryFrame( capture );
if( !frame ) break;
cvShowImage( "Example2", frame );
char c = cvWaitKey(33);
if( c == 27 ) break;
}
cvReleaseCapture( &capture );
cvDestroyWindow( "Example2" );
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.)
p.s.: I need to open these filetypes: avi (DivX, Xvid, uncompressed), flv, wmv, mpg.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|