@echo off
set ztmp_ffmpeg=C:\bin\ffmpeg64.exe
setlocal EnableExtensions
setlocal EnableDelayedExpansion
set ztmp_src=%1
set ztmp_dest=%~n1.webm
if exist "%ztmp_src%" (
%ztmp_ffmpeg% -y -i "%ztmp_src%" -pass 1 -vf scale=1920:1080 -c:v libvpx-vp9 -crf 10 -b:v 3500k -threads 1 -tile-columns 0 -frame-parallel 0 -g 30 -aq-mode 0 -an -f webm "%ztmp_dest%"
%ztmp_ffmpeg% -y -i "%ztmp_src%" -pass 2 -vf scale=1920:1080 -c:v libvpx-vp9 -crf 10 -b:v 3500k -threads 1 -tile-columns 0 -frame-parallel 0 -auto-alt-ref 1 -lag-in-frames 25 -g 30 -aq-mode 0 -an -f webm "%ztmp_dest%"
del ffmpeg2pass-0.log
) else (
echo Could not find file %ztmp_src%
goto :failed
)
goto :cleanup
:cleanup
set "ztmp_src="
set "ztmp_dest="
goto :eof
:failed
echo This stage of the encoding has failed...
goto :cleanup