[vtkusers] continuous saving of image frames

Sean Ziegeler seanzig at users.sourceforge.net
Mon Apr 16 17:14:02 EDT 2007


One source of latency is usually the compression.  You might consider 
either cranking it down or turning it off (if the classes expose methods 
for that, I can't recall off of the top of my head).  Or using a very 
basic format without compression like PPM.  I also can't remember if VTK 
has a PPM writer.

However, you can write your own PPM files.  It's basically a dump of raw 
binary RGB's (probably what you've already done with fwrite) with a 
small header at the top.  Use the binary format, not the ASCII one.

Tim Soper wrote:
> Hi-
>    I've been writing a subclass for vtkVideoSource to grab frames in a custom application. I'm at the point where I would like to continuously save captured frames to individual files. While continuous display of video frames works nicely (30Hz+), saving the images using vtkPNGWriter or vtkBMPWriter (those are the two I tried) is drastically slowing my application. At most I can save 2-4 frames per second. To compare, I tried writing the bitmap data to files directly in a raw format using the c++ command fwrite( ) and was able to save images easily at 10 fps. Is there a way to speed up the process using a vtkImageWriter subclass. Any help would be greatly appreciated.
>  
> Tim Soper
> 
> Research Assistant
> University of Washington
> Department of Bioengineering 
> Box 352142
> 




More information about the vtkusers mailing list