Skip to content

Instantly share code, notes, and snippets.

@sfan5
Last active April 28, 2017 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sfan5/6fe36beba3e3909b5629bee72b4c62f7 to your computer and use it in GitHub Desktop.
Save sfan5/6fe36beba3e3909b5629bee72b4c62f7 to your computer and use it in GitHub Desktop.
script for twopass encoding of webms
#!/bin/bash -e
src="2QO90IaN_UM.mkv"
dst="a.webm"
opts="-vf scale=1280:720 -threads 10"
aopts="-c:a libopus -b:a 128k"
vopts="-c:v libvpx-vp9 -b:v 1024k -tile-columns 6 -frame-parallel 1 -row-mt 1"
vopts_final="-auto-alt-ref 1 -lag-in-frames 25"
ffmpeg -i "$src" $opts \
-pass 1 -passlogfile "ffmpeg2pass-${src%.*}" \
$vopts -speed 4 \
-an \
-f webm -y /dev/null
ffmpeg -i "$src" $opts \
-pass 2 -passlogfile "ffmpeg2pass-${src%.*}" \
$vopts $vopts_final \
$aopts \
"$dst"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment