Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "cv.h"
- #include "cxcore.h"
- #include "highgui.h"
- #include "math.h"
- #include <iostream>
- #include <fstream>
- #include <stdlib.h>
- #include <sys/stat.h>
- #include <stdio.h>
- #include <string.h>
- #include <sstream>
- using namespace std;
- IplImage *src;
- int main(){
- CvCapture* capture = cvCreateFileCapture("test.avi");
- double frameRate = 25.0;
- CvVideoWriter *vdowriter = cvCreateVideoWriter( "newtest.flv", CV_FOURCC('F', 'L', 'V', '1'), frameRate, cvSize(320,240) );
- if(!cvQueryFrame(capture)){ cout<<"Video capture failed, please check the camera."<<endl;}else{cout<<"Video camera capture status: OK"<<endl;};
- CvSize sz = cvGetSize(cvQueryFrame( capture));
- int in=0;
- while((src = cvQueryFrame(capture)) != NULL){
- cvWriteFrame(vdowriter,src);
- if( (cvWaitKey(40) & 255) == 27 && in==200 )
- break;
- in++;
- }
- cvReleaseVideoWriter(&vdowriter);
- cvReleaseCapture( &capture);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement