title: Video Morph Between Two Images, FFMPEG/Minterpolate
body: <p>I am trying to make a quick and easy morph video using two frames (png images) with ffmpeg's minterpolate filter, in a bash script on Ubuntu Linux. The intent is to use the morphs as transitions between similar video in a different video editor later.</p>
  <p>It will work on 3+ frames/images, but <strong>fails using just 2 frames/images.</strong></p>
  <h2>First the code that works: 3 frames</h2>
  <p>This is using three 1080p png files:</p>
  <p><code>test01_01.png</code>
  <code>test01_02.png</code>
  <code>test01_03.png</code></p>
  <pre><code>input01=&quot;test01_%02d.png&quot;
  
  ffmpeg -y -fflags +genpts -r 30 -i $input01 -vf &quot;setpts=100*PTS,minterpolate=fps=24:scd=none&quot; -pix_fmt yuv420p &quot;test01.mp4&quot;
  </code></pre>
  <p>This takes a bit of processing time, then creates a 414kb, roughly three second mp4 video of a morph starting with the first frame, morphing to the second, then morphing to the third.</p>
  <h2>The code that fails: 2 frames</h2>
  <p>This is using just two of the same 1080p png files:</p>
  <p><code>test02_01.png</code>
  <code>test02_02.png</code></p>
  <pre><code>input01=&quot;test02_%02d.png&quot;
  
  ffmpeg -y -fflags +genpts -r 30 -i $input01 -vf &quot;setpts=100*PTS,minterpolate=fps=24:scd=none&quot; -pix_fmt yuv420p &quot;test02.mp4&quot;
  </code></pre>
  <p>This almost immediately creates a 262 <strong>byte</strong> corrupt mp4 file. There are no differences except the number of frames.</p>
  <h2>Things I've tried:</h2>
  <p>I have tried this with the Ubuntu default repo version of ffmpeg, and the static 64bit 5.0 and git-20220108-amd64 versions, all with the same result.</p>
  <p>I have also tried with a 2-frame mp4 file as the input, with the same result.</p>
  <h2>Thoughts?</h2>
  <p>Is this a bug in ffmpeg or am I doing something wrong?</p>
  <p>I am also open to any suggestions for creating a morph like this using other Linux-compatible software.</p>
  <p>Thank you for any insight!</p>