[Python] imgChecker


If you’ve spent any time trying to get renders out of After Effects faster I’m sure you’ve tried solutions that run multiple instances of aerender through render managers such as Deadline. I’m sure you’ve also had this solution cause many MANY crashes due to AE being such a glutton for RAM. The worst thing about this is that AE will leave a frame only partially written to disk, so when importing into a new project there wont be a helpful popup telling you “frames X, Y, and Z are missing“. When trying to render out a comp that includes these corrupt frames sometimes there will be no error, and sometimes the render will fail and the logs wont tell you what specifically caused the failure.

Checking potentially tens of thousands of frames manually is near impossible and if the crash happened when the frame was 99.9% written it can be easy to miss when checking visually. Enter my very VERY janky python script; imgChecker. Using the PIL library and some very rudimentary threading it is able to check hundreds of FHD images per second and return a list of all of the corrupted frames in the sequence. Simply define a number of threads to run, the path to the folder that the images are contained within, and the file extension type, then hit go. This script was cobbled together very quickly and only relies on catching an exception from PIL opening the files, so there may be edge cases where it is unable to detect corrupt frames. In my experience however, it is outstanding at catching the types of corrupt, partially written frames that result from AE crashing while rendering. There is also no thread scheduling so in the instance of many corrupted frames being found simultaneously, the python console can get a bit garbled due to race conditions. The list output at the end of the script has always been reliable though, so I’m going to call the print() race conditions an acceptable bug for now.

I do have plans to revisit this in the future to implement checking for .exr files, and maybe proper thread scheduling. In the mean time feel free to use this script!

Previous
Previous

[Fusion] UltraSplitter