[vtkusers] Problems with vtkAVIWriter
Mark Wyszomierski
markww at gmail.com
Mon Feb 11 11:27:10 EST 2008
Christina,
Not sure if this is the problem, but in some code I have I don't call
SetInput() in my for loop. I just modify the pixel buffer and call
write(), and it works ok. Something like:
vtkImageData pImgBuffer = vtkImageData::New();
m_pAVIWriter = vtkAVIWriter::New();
m_pAVIWriter->SetInput(pImgBuffer);
m_pAVIWriter->SetFileName("movie.avi");
m_pAVIWriter->Start();
for (int i = 0; i < numFramesYouWant; i++) {
// Just modify pImgBuffer instead of calling setInput again...
drawIntoImgBuffer(pImgBuffer);
// then call write.
m_pAVIWriter->Write();
}
m_pAVIWriter->End();
m_pAVIWriter->Delete();
That works ok for me,
Mark
On Feb 11, 2008 3:39 AM, Christina Lacalli
<christina.lacalli at igd.fraunhofer.de> wrote:
> Hello,
>
> I want to create a movie using the vtkAVIWriter.
> I have a set of vtkImageData stored in a buffer
> (std::vector<vtkImageData*>) and each representing a frame at time t.
> I tried to use vtkAVIWriter as it is used in "vtkAVIWriter (Tests)" but
> it doesn't work correctly. I just get one static image.
> What I did is:
>
> m_pAVIWriter = vtkAVIWriter::New();
> m_pAVIWriter->SetInput(m_pBuffer[0]);
> m_pAVIWriter->SetFileName("movie.avi");
> m_pAVIWriter->Start();
>
> for (int i = 0; i < m_pBuffer.size(); i++){
> m_pAVIWriter->SetInput(m_pBuffer[i]);
> m_pAVIWriter->Write();
> }
> m_pAVIWriter->End();
>
> Any suggestions what is wrong here?
>
> Thanks in advance,
> Christina
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list