Frames to Video Automation
I often render out frames when doing a little 3D work, whether it be for an example of something for a test or a turn around, and then need to convert it to a video file for sharing out, either to collegues or the socials. For the longest time I was just cutting and pasting my command, and then arrowing through it and altering the file name, frame start, and output name. Tedious to say the least. Python to the rescue!
This is a pretty straight forward script, I just run it from my render location, or as a post render process. It grabs the file names, the frame count, sets the command, and renders out an mp4 named after the file name of the frame. Once it’s done it creates a directory, and moves the frames into that to clean things up. The only real dependancies are you should have ffmpeg in a system path so the script doesn’t need to know where it is, and the frames should be padded out to 4 digits with a delimiter of _ as an example animTest_0001.jpg. The script also looks for either jpg, tif or tga’s as these are what I commonly use in my home pipeline.
The framerate is hard coded currently to 30fps, but that is easy to alter in the script, or just make a copy and have a 30fps and a 24fps version for the sake of running it automated. Currently this isn’t doing any form of error checking, but right now it doesn’t really need it, I’ll probably come back to it at a later date and add that in as well as making an interactive version that will let you set a frame rate, change the output name, those sorts of things.
No Comments