I've read several similar posts on this issue but none seem to help me directly. If this actually is a duplicate post, please direct me to the thread containing the solution!
I'm saving a bunch of images and then calling ffmpeg on them with subprocess.call. I do this some number of times for collections of different images. This is basically what I'm doing:
from subprocess import call
for video in videos:
call(['ffmpeg', ..., '-i', video, video+'.mp4')])
In isolation this works fine. However, when I also have some other processing done before these calls (not within the loop, literally just holding values in memory before the loop starts), it crashes with a memory error after having made several of the videos (actually while making the last one). According to this comment, subprocess.call forks/clones the current process, which seems to mean that it requests a memory allocation equal to how much I currently have in memory, which seems to be way overkill for what I want to do in calling ffmpeg.
How can I call ffmpeg from within python without asking to allocate unnecessary amounts of memory?