Posted: . At: 9:55 AM. This was 2 years ago. Post ID: 16447
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


How to encode a vp9 webm and OPUS audio very easily with ffmpeg.


Encoding a VP9 WebM with OPUS audio is very easy with FFmpeg. This is using a 2-pass procedure to encode a good quality VP9 WebM.

Do the first pass, this will write a ffmpeg2pass-0.log file, this stores the settings to use for the 2nd pass.

┌──(john㉿DESKTOP-PF01IEE)-[/mnt/e/Downloads]
└─$ ffmpeg -ss 00:02:00 -t 20 -i Nosferatu_1922_Symphony_of_Horror.avi -threads 0 -vf scale=960:720 -g 999 -c:v libvpx-vp9 -c:a libopus -b:v 3M -crf 45 -qmin 35 -qmax 63 -y -sn -pass 1 vanp.webm

Then do the 2nd pass to properly encode the final encoded WebM file.

┌──(john㉿DESKTOP-PF01IEE)-[/mnt/e/Downloads]
└─$ ffmpeg -ss 00:02:00 -t 8 -i Nosferatu_1922_Symphony_of_Horror.avi -threads 0 -vf scale=960:720 -g 999 -c:v libvpx-vp9 -c:a libopus -b:v 3M -crf 45 -qmin 35 -qmax 63 -y -sn -pass 2 vanp.webm

This is the final encoded WebM file I managed to make with these commands.

This turned out very well indeed. And the clip below shows the quality this gives you.

A very good solution for sharing high-quality video clips online.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.