title: ffmpeg: overlay a png image on a video with custom transparency?
body: <p>Suppose I have a video <code>foo.mkv</code> and an image <code>bar.png</code> (which happens to contains an alpha channel). I can blend this image over the video like this:</p>
  
  <pre><code>ffmpeg 
   -i foo.mkv 
   -i bar.png 
   -filter_complex "[0:v][1:v]overlay" 
   -vcodec libx264 
   myresult.mkv
  </code></pre>
  
  <p>(using multiple lines here for readability, normally this is one command line).</p>
  
  <p>Now, besides the png image having an alpha channel of its own, I would also apply a custom <em>overall transparency</em> when blending this image over the video.</p>
  
  <p>In the above example, the image would be visible 100% on top of the video — or at least the parts where its alpha channel is fully opaque.</p>
  
  <p>Is there a way to add a custom overall opacity or transparency blend factor, something like <code>opacity=0.5</code> or whatever, which would make the image only 50% visible?</p>