videowriter writes only 128 bytes files
I thought i would ask here as well. http://stackoverflow.com/questions/36...
Whenever i want to write a movie videowriter only writes files of 128 bytes on Mac. I tried almost every codec. Does anyone have a mac and can they use below examples to see if it works for them?
Many thanks, atv
#include <opencv2 opencv.hpp=""> #include <opencv2 highgui="" highgui.hpp=""> int main( int argc, char** argv ) { CvCapture* capture; capture = cvCreateCameraCapture(0); assert( capture != NULL ); IplImage* bgr_frame = cvQueryFrame( capture ); CvSize size = cvSize( (int)cvGetCaptureProperty( capture, CV_CAP_PROP_FRAME_WIDTH), (int)cvGetCaptureProperty( capture, CV_CAP_PROP_FRAME_HEIGHT) ); cvNamedWindow( "Webcam", CV_WINDOW_AUTOSIZE ); CvVideoWriter *writer = cvCreateVideoWriter( "vidtry.AVI", CV_FOURCC('A','V','C','1'), 30, size ); while( (bgr_frame = cvQueryFrame( capture )) != NULL ) { cvWriteFrame(writer, bgr_frame ); cvShowImage( "Webcam", bgr_frame ); char c = cvWaitKey( 33 ); if( c == 27 ) break; } cvReleaseVideoWriter( &writer ); cvReleaseCapture( &capture ); cvDestroyWindow( "Webcam" ); return( 0 ); }
please do not use the outdated c-api
you don't have the AVC1 codec installed you your box