I think this is a great and better idea.
Anyway, another one I’ve used to deal with this problem is storing each frame in memory, in a List of PImages, not saving them to disk in each draw loop, after all data has processed, I save all the frames stored. Worked fine for me.