30 m_RemoveColouredFrame =
true;
47 m_RemoveColouredFrame = RemoveColouredFrame;
52 m_width = m_renderer->GetRenderWindow()->GetSize()[0];
53 m_height = m_renderer->GetRenderWindow()->GetSize()[1];
55 if(m_RemoveColouredFrame)
61 m_width -= m_width % 4;
62 m_height -= m_height % 4;
64 m_currentFrame = cvCreateImage(cvSize(m_width,m_height),8,3);
65 m_currentFrame->origin = 1;
89 if(m_FourCCCodec != NULL)
92 m_aviWriter = cvCreateVideoWriter(m_sFile.c_str(),CV_FOURCC(m_FourCCCodec[0],m_FourCCCodec[1],m_FourCCCodec[2],
93 m_FourCCCodec[3]),m_dwRate,cvSize(m_width,m_height),1);
95 m_aviWriter = cvCreateVideoWriter(m_sFile.c_str(),CV_FOURCC(m_FourCCCodec[0],m_FourCCCodec[1],m_FourCCCodec[2],
96 m_FourCCCodec[3]),m_dwRate,cvSize(m_width,m_height));
102 m_aviWriter = cvCreateVideoWriter(m_sFile.c_str(),-1,m_dwRate,cvSize(m_width,m_height),1);
104 m_aviWriter = cvCreateVideoWriter(m_sFile.c_str(),CV_FOURCC(
'X',
'V',
'I',
'D'),m_dwRate,cvSize(m_width,m_height));
111 std::cout <<
"errors initializing video writer...correct video file path? on linux: ffmpeg must be included in OpenCV.";
122 memcpy(m_currentFrame->imageData,data,m_width*m_height*3);
123 cvWriteFrame(m_aviWriter,m_currentFrame);
132 cvReleaseVideoWriter(&m_aviWriter);
void SetRemoveColouredFrame(bool)
virtual bool InitGenerator() override
called directly before the first frame is added
virtual void SetFileName(const char *fileName) override
filename under which movie is saved
virtual bool AddFrame(void *data) override
used to add a frame
virtual bool TerminateGenerator() override
called after the last frame is added
virtual void SetFrameRate(int rate)