Skip to content

Instantly share code, notes, and snippets.

@calvinbui
Created July 11, 2018 13:56
Show Gist options
  • Save calvinbui/cde91de94836b538bde8b4e892170e2c to your computer and use it in GitHub Desktop.
Save calvinbui/cde91de94836b538bde8b4e892170e2c to your computer and use it in GitHub Desktop.
High quality MP4 to WebM
$Dir = get-childitem . | where {$_.extension -eq ".mp4"}
Foreach ($file in $Dir){
$output = $file | % {$_.BaseName}
$input = $file
.\ffmpeg.exe -i "$input" -an -c:v libvpx -pix_fmt yuv420p -threads 4 -slices 8 -lag-in-frames 16 -auto-alt-ref 1 -ac 2 -c:a libvorbis -qmin 17 -crf 17 -qmax 17 -qcomp 1 -b:v 0 -qscale:a 10 -pass 1 -passlogfile "C:\Users\Calvin\AppData\Local\Temp\75b67ed3-075e-4eb7-b783-41b40406e7c4" -f webm -y "NUL"
.\ffmpeg.exe -i "$input" -c:v libvpx -pix_fmt yuv420p -threads 4 -slices 8 -lag-in-frames 16 -auto-alt-ref 1 -ac 2 -c:a libvorbis -qmin 17 -crf 17 -qmax 17 -qcomp 1 -b:v 0 -qscale:a 10 -pass 2 -passlogfile "C:\Users\Calvin\AppData\Local\Temp\75b67ed3-075e-4eb7-b783-41b40406e7c4" -f webm -y "$output.webm"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment