jloyd / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

Issue in JPG to Mpg conversion #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I m nt familiar to this library and trying to convert some jpg images into mpg 
file through CvVideoWriter 
i m using this code bt getting exception 

IplImage img1 = cvLoadImage("Power.jpg", CV_LOAD_IMAGE_UNCHANGED);
IplImage img2 = cvLoadImage("Power.jpg", CV_LOAD_IMAGE_UNCHANGED);

double fps = 20;

CvVideoWriter writer = cvCreateVideoWriter("out.mpg", 
CV_FOURCC('P','I','M','1'), fps,cvGetSize(img1), 20);

        if (writer!=null)
        {
        Log.e("VideoWriter failed","");
        }
cvWriteFrame(writer, img1);
cvWriteFrame(writer, img2);
cvReleaseVideoWriter(writer);
cvReleaseImage(img1);
cvReleaseImage(img2);

getting Run time exception ...

java.lang.RuntimeException: 
/home/saudet/workspace/android/OpenCV-2.3.0/modules/core/src/array.cpp:1238: 
error: (-5) Array should be CvMat or IplImage in function CvSize 
cvGetSize(const CvArr*)

Original issue reported on code.google.com by arslan.o...@gmail.com on 28 Jul 2011 at 7:12

GoogleCodeExporter commented 9 years ago
Just do it the same way as the Demo sample provided in the README.txt file, and 
please post your questions on the mailing list... questions != issues

Original comment by samuel.a...@gmail.com on 28 Jul 2011 at 7:19