Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ffmpeg video to webm converter with prompts (needs ffmpeg in PATH)
@echo off
echo ^>--- FFmpeg webm ---
echo.
set /P ffinput=">Input file: "
set /P ffbitrate=">Bitrate (e.g. 500k): "
set /P ffss=">Start time (hh:mm:ss): "
set /P ffduration=">Duration (ss): "
set /P fffps=">FPS: "
echo.
echo ^>ffmpeg -i %ffinput% -c:v libvpx -b:v %ffbitrate% -ss %ffss% -t %ffduration% -quality good -cpu-used 0 -r %fffps% -auto-alt-ref 1 -lag-in-frames 16 -vf scale=-1:720 -an -pass 1 -f webm null
echo.
echo ^>ffmpeg -i %ffinput% -c:v libvpx -b:v %ffbitrate% -ss %ffss% -t %ffduration% -quality good -cpu-used 0 -r %fffps% -auto-alt-ref 1 -lag-in-frames 16 -vf scale=-1:720 -an -pass 2 -f webm %ffinput%.webm
echo.
set /P ans=">Continue (y/n)? "
if /i {%ans%}=={y} (goto :run)
if /i {%ans%}=={yes} (goto :run)
goto :exit
:run
ffmpeg -i %ffinput% -c:v libvpx -b:v %ffbitrate% -ss %ffss% -t %ffduration% -quality good -cpu-used 0 -r %fffps% -auto-alt-ref 1 -lag-in-frames 16 -vf scale=-1:720 -an -pass 1 -f webm null
ffmpeg -i %ffinput% -c:v libvpx -b:v %ffbitrate% -ss %ffss% -t %ffduration% -quality good -cpu-used 0 -r %fffps% -auto-alt-ref 1 -lag-in-frames 16 -vf scale=-1:720 -an -pass 2 -f webm %ffinput%.webm
del null
del ffmpeg2pass*.log
echo ^>Done.
goto :exit
:exit
echo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.