Hi,

I am trying to create a video what I showed on the osgviewer. For Creating 
Video I am using OpenCV. I got the screen capture into an osg::Image (I 
followed ScreenCapture example). Now I converted this image into OpenCV 
IplImage and added to the cvVideoWriter.

But I am getting flipped video with only one channel.

Here is my code

Creating OpenCV video writer


Code:
CvSize imgSize;
imgSize.width = 1024;
imgSize.height = 768;
CvVideoWriter* 
m_VideoWriter=cvCreateVideoWriter("out.avi",CV_FOURCC('D','I','V','X'),10,imgSize);



Converting osg::Image to IplImage and adding to Video Writer


Code:
IplImage* myIplImage = cvCreateImage(cvSize(1024,768), IPL_DEPTH_8U, 3);
cvSetData(myIplImage,sCapImage->data(),1024*3); 
cvWriteFrame( m_VideoWriter, myIplImage);
cvReleaseImage(&myIplImage);



When I save the screencapture the image is saved correctly.

Can any one please help me how to convert from osg::Image to IplImage?
... 

Thank you!

Cheers,
Koduri

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=49157#49157




_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to