bahador saket
unread,May 28, 2010, 12:27:07 AM5/28/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to FIT Cafeteria
Dear All
I wrote the program, it should save the video but unfortunately I do
not know why it does not work correct.
Exactly , it represent the error like following statement:
[avi @0x1da1060] could not find codec parametrs.<video mjpeg>
my program:
#include <cv.h>
#include <highgui.h>
int main(int argc, char* argv[]) {
CvCapture* capture = NULL;
capture = cvCreateFileCapture(argv[1]);
if(!capture){
return -1;
}
IplImage *bgr_frame=cvQueryFrame(capture);//Init the video read
double fps = cvGetCaptureProperty (capture,CV_CAP_PROP_FPS);
CvSize imgSize;
imgSize.width = bgr_frame->width;
imgSize.height = bgr_frame->height;
CvVideoWriter *writer =
cvCreateVideoWriter("bahador",CV_FOURCC('M','J','P','G'),fps,imgSize);
IplImage* logpolar_frame =
cvCreateImage(imgSize,IPL_DEPTH_8U,3);
while( (bgr_frame=cvQueryFrame(capture)) != NULL ) {
cvLogPolar( bgr_frame,
logpolar_frame,cvPoint2D32f(bgr_frame->width/
2,
bgr_frame->height/2),
40,
CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS );
cvWriteFrame( writer, logpolar_frame );
}
cvReleaseVideoWriter( &writer );
cvReleaseImage( &logpolar_frame );
cvReleaseCapture( &capture );
return(0);
}
Regards,
Bahador Saket