title: How to keep transparency when converting .avi to .webm with ffmpeg
body: <p>I have a small avi file I rendered with After Effects with both RGB and Alpha channels, therefore keeping its transparency. However, when converting this .avi to webm, all transparency is lost.</p>
  
  <p>here is the the command line I use to convert my file : </p>
  
  <blockquote>
    <p>ffmpeg.exe -i input.avi -c:v libvpx-vp9 -pix_fmt yuv420p -an -crf 30 -b:v 0  output.webm</p>
  </blockquote>
  
  <p>The video file is rendered but all transparency is lost. How can I keep that transparency?</p>
  
  <p>edit : yuv422p was automatically selected if I removed "-pix_fmt yuv420p" from the command line. Adding "-pix_fmt yuva420p" instead did not fix the issue, but was necessary. Adding "-metadata:s:v:0 alpha_mode="1"" to the command line did the trick (along with the pixel format change).</p>