title: FFmpeg WebM AV1 Support
body: <p>With FFmpeg how can I use <code>AV1</code> codec in a <code>webm</code> container?</p>
  
  <p>I get the error:</p>
  
  <pre><code>Only VP8 or VP9 video and Vorbis or Opus audio and WebVTT subtitles are supported for WebM.
  Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
  Error initializing output stream 0:0 --
  </code></pre>
  
  <hr>
  
  <p>However Wikipedia says WebM supports AV1.</p>
  
  <p><a href="https://en.wikipedia.org/wiki/AV1" rel="noreferrer">https://en.wikipedia.org/wiki/AV1</a></p>
  
  <p><code>AV1 is intended to be able to be used together with the audio format Opus in a future version of the WebM container format for HTML5 web video</code></p>
  
  <p>Or can FFmpeg simply not encode this new version?</p>
  
  <hr>
  
  <p>My settings:</p>
  
  <pre><code>ffmpeg -y 
  
  -i "C:\Users\Matt\video.mp4" 
  
  -c:v libaom-av1 -strict experimental 
  -cpu-used 1 -crf 28 
  -pix_fmt yuv420p 
  -map 0:v:0? -map_chapters -1 
  -sn 
  
  -c:a libopus 
  -map 0:a:0? 
  
  -map_metadata 0 
  
  -f webm 
  
  -threads 0 
  
  "C:\Users\Matt\video.webm"
  </code></pre>