title: Efficient command line to crop a video, overlay another crop from it and scale the result with ffmpeg
body: <p>I need to convert many videos in such a way that I take 2 different crops from each frame of a single video, stack them one over the other and scale down the result, creating a new smaller video. 
  I want to convert <a href="https://i.stack.imgur.com/fNRoX.jpg" rel="nofollow noreferrer">this fullHD frame</a> (two crop areas are marked red) to this <a href="https://i.stack.imgur.com/IWiVP.png" rel="nofollow noreferrer">small stacked frame</a>.</p>
  
  <p>Right now I use the following code:</p>
  
  <pre><code>ffmpeg  -i "video.mkv" -filter:v "crop=560:416:0:0" out1.mp4
  ffmpeg  -i "video.mkv" -filter:v "crop=560:384:1060:128" out2.mp4
  ffmpeg  -i out1.mp4 -vf "movie=out2.mp4[inner]; [in][inner] overlay=0:32,scale=280:208[out]"  -c:v libx264 -preset veryfast -crf 30 result.mp4
  </code></pre>
  
  <p>It works but it is very inefficient and requires temporary files (out1 and out2). And the problem is I have over 100.000 of such videos (they are big and stored on a NAS and not directly on my computer's HDD). Converting all of them with a Windows batch script (for loop) will take...48 days. Can you help me to optimize the script?</p>