saving video with log-polar has some error.. [closed]

asked 2018-01-09 03:57:38 -0600

rangora gravatar image

updated 2018-01-09 03:58:26 -0600

i like to save 'movie.mkv' file with log-polar so that make 'saved_movie.avi'.

but its occurred error.

here is my codes.

CvCapture* capture = cvCreateFileCapture("movie.mkv");
if (!capture) { cout << "capture error" << endl; return -1; }

IplImage* bgrFrame = cvQueryFrame(capture);
double fps = cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
CvSize size = cvSize((int)cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH),
    (int)cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT));

CvVideoWriter* writer = cvCreateVideoWriter("saved_movie.avi", -1, fps, size);  

IplImage* logPolarFrame = cvCreateImage(size, IPL_DEPTH_8U, 3);

while ((bgrFrame = cvQueryFrame(capture)) != NULL) {
    cvLogPolar(bgrFrame, logPolarFrame, cvPoint2D32f(bgrFrame->width / 2,
        bgrFrame->height / 2),
        40,
        CV_INTER_LINEAR + CV_WARP_FILL_OUTLIERS);
    cvWriteFrame(writer, logPolarFrame);
}

cvReleaseVideoWriter(&writer);
cvReleaseImage(&logPolarFrame);
cvReleaseCapture(&capture);

return 0;

and console show this.

openCV: FFMPEG: tag 0xffffff/' ' is not found (format 'avi / AVI (audio Vidio interleaved)')'

i download ffmpeg in c: and set enviroment path c:/ffmpeg/bin but nothing was changed.

i think it's codec prablems but i have no idea.. :( and i using os(window10) and visual studio2017.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by berak
close date 2018-01-09 03:58:48.370134

Comments

opencv's c-api is no more maintained since 2010, you MUST NOT USE it !

berak gravatar imageberak ( 2018-01-09 03:59:31 -0600 )edit