title: OSError: [Errno 12] Cannot allocate memory from python subprocess.call
body: <p>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!</p>
  
  <p>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:</p>
  
  <pre><code>from subprocess import call
  for video in videos:
    call(['ffmpeg', ..., '-i', video, video+'.mp4')])
  </code></pre>
  
  <p>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 <a href="https://stackoverflow.com/a/13329386/354979">this comment</a>, 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.</p>
  
  <p>How can I call ffmpeg from within python without asking to allocate unnecessary amounts of memory?</p>