// Video. cpp: defines the entry point for the console application.
// Convert a video to grayscale
// Argv [1]: input video file
// Argv [2]: name of new output file
# Include "stdafx. H"
# Include "cv. H"
# Include "highgui. H"
Int main (INT argc, char * argv [])
{
Cvcapture * capture = 0;
Capture = cvcreatefilecapture ("pan_stab_new border_11 _ 9.avi ");
If (! Capture ){
Return-1;
}
// Init the video read
Iplimage * bgr_frame = 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 (
"Result. Avi ",
Cv_fourcc ('M', 'J', 'P', 'G '),
FPS,
Size
);
Iplimage * logpolar_frame = cvcreateimage (
Size,
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;
}
Note: The K-lite codec pack is installed and the file can be read. The file "result. Avi" is 0 kb. Unsolved ····