I am using Processing IDE to generate hundred short video clips for a computer vision project. Right now, I am using Python to create a .pde
file and run it. This looks roughly like:
PATH = "/my/local/director/"
list_of_variables = [1, 2, etc.]
for i in list_of_variables:
naming = "p5_{:02d}_myfile".format(i)
os.mkdir(PATH + naming)
with open(PATH + naming + "/" + naming + ".pde", 'w') as pdefile:
pdefile.write("contents of file go here " + i ";\n")
pdefile.write("saveFrame(\"frames/######.tif\");\n")
subprocess.Popen(["processing-ide", "--sketch=" + PATH + naming, "--run"], stdout=subprocess.DEVNULL)
subprocess.call(["ffmpeg", "-i", PATH + naming + "/frames/%06d.tif", PATH + naming + "out.mp4"], stdout=subprocess.DEVNULL)
shutil.rmtree(PATH + naming + "/frames/")
Every time code is executed, Processing IDE opens a preview window to show what is happening. Is there an option I can pass in the execution step or in the .pde
file creation that will prevent the preview window from showing. This is taking a long time, and I'm hoping this would speed things up.
Note: Yes, I have considered that there are better options for generating these videos. In retrospect, I should have used OpenCV
in Python to speed things up, but that isn't the thrust of this question.