Use a variable min_f based on total number of frames.
Rework parts of prepare code to use command queue based multiprocessing.