[vtkusers] How to write AVI files properly, Please Help

Janny Dong janny.dong at gmail.com
Tue May 29 21:52:46 EDT 2007


Hi All,

I found there are member functions like SetRate() and SetQuality() in
vtkAVIWriter in the documentation:

http://www.vtk.org/doc/nightly/html/classvtkAVIWriter.html#b03cfb7526619c6fa87ea0ba594d6f4f

but I can't use them. So are they not available yet? I am using VTK 5.0. It
would be nice if these functions are available.

Beau, the default frame rate is 15 fps, and the movie size may be related to
the window size you set at RenderWindow->setsize().

My problem didn't get solved, please continue to help.

Thanks,
Janny
On 5/29/07, Beau Sapach <beau.sapach at ualberta.ca> wrote:
>
>  I think I had a similar problem, not the size issue but the single,
> static image issue.  Try calling Modified() on vtkWindowToImageFilter before
> you call Update().  As for frame rate I don't know how to set that with
> vtk's classes, I suggest you look at FFMPEG, it can be built into VTK but
> I've had little luck doing so.  Currently I write out image files and have
> my application call the ffmpeg executable to encode the images as a movie,
> using ffmpeg command line options you can control framerate.
>
>
>
> Beau
>
>
>  ------------------------------
>
> *From:* vtkusers-bounces+beau.sapach=ualberta.ca at vtk.org [mailto:
> vtkusers-bounces+beau.sapach=ualberta.ca at vtk.org] *On Behalf Of *Janny
> Dong
> *Sent:* Tuesday, May 29, 2007 8:24 AM
> *To:* vtkusers
> *Subject:* [vtkusers] How to write AVI files properly, Please Help
>
>
>
> I posted a similar question but didn't get any answer, probably I didn't
> make it clear enough.
>
> I am coding a C++ program to visualize my data and generate movie
> automatically. I put vtkAVIWriter in a loop to get a movie out of the
> rendering. It did get an avi file, but not the one I expected. I have two
> questions about it.
>
> (1) The size of the movie file is 18MB, but it has only 50 frames.
> Moreover, it is only 3 second long. Can I compress the movie file with
> vtkAVIWriter? How can I control the speed of the movie, like specifying
> number of frames per second?
>
> (2) I found the avi file displayed only one frame like a static image.
> However, I did update the data when rendering each frame. The data rendering
> part in my program is like
> data
> points--->vtkPolyData--->vtkDelaunay2D--->vktPolyDataMapper--->vtkRenderer--->vtkWin32OpenGLRenderWindow->SetOffScreenRendering(1)--->vtkWindowToImageFilter--->vtkAVIWriter
>
>
> I have something like: PolyDataMapper->update(); WindowToImage->update()
> in my code.  Did I call update() in a wrong way or should I call it in
> different parts of the code?
>
> Any suggestions will be greatly appreciated.
>
> Janny
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070529/1b2999b2/attachment.htm>


More information about the vtkusers mailing list