Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Conversion Script from MP4 to WebM in good quality
#!/bin/sh
set -ex
for i in *.mp4; do
ffmpeg -y -i "$i" -c:v libvpx-vp9 -pass 1 -b:v 2M -crf 30 -threads 8 -speed 4 \
-pix_fmt yuv420p -tile-columns 6 -frame-parallel 1 \
-an -f webm /dev/null
ffmpeg -i "$i" -c:v libvpx-vp9 -pass 2 -b:v 2M -crf 30 -threads 8 -speed 2 \
-pix_fmt yuv420p -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 \
-c:a libopus -ac 2 -b:a 128k -f webm $(basename "${i/.mp4}").webm
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment