Skip to content

Instantly share code, notes, and snippets.

@sturmen
Created May 12, 2017 18:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturmen/6b0791dca01dae5a2bbbea8460bf8208 to your computer and use it in GitHub Desktop.
Save sturmen/6b0791dca01dae5a2bbbea8460bf8208 to your computer and use it in GitHub Desktop.
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
@Ensyllis
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment