@echo off
set inDir=.\in
set outDir=.\out
if not exist %inDir% goto :eof
for /r %%i in (%inDir%\*.mp4) do set video=%%~ni& call :convert
goto :eof
:convert
if not exist %outDir% md %outDir%
ffmpeg -threads 0 -i %inDir%\%video%.mp4 -c:v libvpx-vp9 -row-mt 1 -crf 31 -b:v 0 -pass 1 -c:a libvorbis -movflags +faststart -an -f null -
ffmpeg -threads 0 -i %inDir%\%video%.mp4 -c:v libvpx-vp9 -row-mt 1 -crf 31 -b:v 0 -pass 2 -c:a libvorbis -movflags +faststart -an %outDir%\%video%.webm