title: How to reduce output file size with ffmpeg?
body: <p>I'm trying to create a tool with a very specific use case: I have two JPEG files and I want to create an output video that starts by showing one image for n seconds, crossfades to the other, then shows the second image for n seconds (for showing a before/after). I have this working but my best result so far is a 10 second video with a file size of 842k. I'd like to get as small as possible without losing obvious quality.</p>
  
  <p>I'm an ffmpeg novice and after reading the docs several times, I'm not sure what the best strategy is. Is the fact that the image won't change for the first or second n seconds something that is possible to capitalize on? Are there other more general strategies?</p>
  
  <p>I'm using ffmpeg 3.4.1. Here is my current command-line for testing:</p>
  
  <pre><code>cat *.jpg | ffmpeg -f image2pipe -i - -vf 'zoompan=d=(4+2)/2:fps=1/2,framerate=25:interp_start=0:interp_end=255:scene=100,scale=1280:-2' -c:v libx264 -crf 27 out.mp4
  </code></pre>