, , FOURCC VideoWriter. CV_CAP_PROP_FOURCC (#defined as 6) , FOURCC, . CV_CAP_PROP_FPS (#defined as 5), VideoWriter 5,0 .
:
#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
if ( argc != 2 ) {
cout << "image required" << endl;
return -1;
}
Mat frame = imread(argv[1], 1);
VideoWriter output_cap("output.avi", CV_FOURCC('M','J','P','G'), 15,
frame.size());
for(int hgf=1; hgf<=300; hgf++) {
output_cap.write(frame);
}
return 0;
}
. Linux VideoWriter , . M-JPEG ( ) H.264, M-JPEG OpenCV 2.4, 3.X H.264 , 2.4 3.X.