I recently had to solve an automation issue, where the client’s desire was to automatically generate hundreds of videos putting side by side a “base video” with a video picked from a list of hundreds. Whilst this could have easily been done by hand with one big effort, the project was an ongoing one, and the number of videos to generate was growing daily. For this reason, I decided to write a small script using Python and ffmpeg that would automatically generate and upload these videos to the client’s Vimeo channel.

This short article is meant to focus on some specific aspects of automation, video editing and Vimeo’s API, thus I won’t spend any time on the Python basics. I will focus on the few bits and bobs that I found challenging and I think are interesting to share.

Preparation

Preparation in an automation job is essential, even more when you’re trying to harvest information from the files themselves. For this reason, I set some ground rules for the video files the script would have dealt with and asked for these to be conformed. The final decision for the file naming was the following:

index_artist name_provenance.extension

With these three simple pieces of information I would have been able to keep track of the videos that had already been generated and customised title and description on Vimeo using the provided metadata. I used the underscores as data separators, and then used the neatly separated data stored in a list whenever it was needed.

#automation #videos #editing #api #python

Automating video editing with Python
1.35 GEEK