[vtkusers] Problems with vtkAVIWriter

Christina Lacalli christina.lacalli at igd.fraunhofer.de
Tue Feb 12 09:12:08 EST 2008


Mark,

thank you so much, now it is working fine :-)
Do you know if there is a way to control the speed of the movie?

Christina

Mark Wyszomierski wrote:
> 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
>>
>>     

-- 
Dipl.-Inform. Christina Lacalli

Fraunhofer Institute for Computer Graphics
Cognitive Computing and Medical Imaging (A7)
Fraunhoferstr. 5, 64283 Darmstadt, Germany

phone: +49 (0)6151 / 155-520
fax:   +49 (0)6151 / 155-480
email: christina.lacalli at igd.fraunhofer.de




More information about the vtkusers mailing list