Combining Python State Files and comparisons with SaveAnimation

I have a workflow where users create ParaView python state files of different images they may want from a data set. The workflow combines the state files, consolidating as many of the filters as possible, but at least consolidating the data reader at the beginning of each state file. From here, I create a combined state file that reads in the data only once, but produces several images. If I feed the combined state file a time series, the state file will read in the first time step and write out several files before moving to the next time step. I do all of this using SaveScreenshot, and it is parallelized to be fairly quick.

In an attempt to expand this workflow to include animations, I’ve swapped out the SaveScreenshot calls for SaveAnimation calls. This drastically affected the speed at which I can produce images. For example, if I use my SaveScreenshot workflow to combine 5 state files and then process a time series of data with 10 timesteps (loading only 1 time step into the reader at a time), I get my 50 images in about 4 minutes. However, if I swap out the SaveScreenshot calls for SaveAnimation calls (and load the entire 10 time step data series with the reader at once), my 50 images are produced in about 15 minutes.

These results suggest to me that when I call SaveAnimation 5 different times it is reloading the time series each time. Is this true? If so, is there any way I can prevent this – cache the data after my first SaveAnimation call so my subsequent calls don’t take so long? The SaveScreenshot route seems to do this just fine (the first image at each time step takes about 10 seconds; each of the subsequent 4 images take about 2 seconds).

Any help will be most appreciated.

1 Like

My workflow involves looping over the timesteps and employing the SaveScreenshot call within that loop to produce individual frames as png-files which I then convert into an h264-mp4 video file (via os.system('ffmpeg ...')).
Works like a charm.

1 Like

The issue is not that either workflow doesn’t work. Both methods produce images and I can certainly call ffmpeg if I want a video. This question is more why there is such a timing different between the two methods.

@Mike Tree This issue is such a critical for me. But thanks for sharing this i realize that i was on wrong track. :slightly_smiling_face: