[vtkusers] Problems with vtkAVIWriter

Mark Wyszomierski markww at gmail.com
Tue Feb 12 09:16:07 EST 2008


I don't know how to control the frame rate (luckily nobody that uses
the thing I wrote has asked for that just yet...). It looks like that
class has some protected members called Rate and Time which maybe
control it? You'd have to check the cxx file to see how they're used,
the documentation says nothing about them,

Mark

On Feb 12, 2008 9:12 AM, Christina Lacalli
<christina.lacalli at igd.fraunhofer.de> wrote:
> 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