Last active
February 3, 2024 21:15
-
-
Save ni554n/230b8b7c7fead492ebe40760d1a5591d to your computer and use it in GitHub Desktop.
Convert a folder of GIFs to WEBM with FFMPEG.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
ECHO :: GIF to WEBM Converter :: | |
ECHO --------------------------- | |
:: Replace this ffmpeg variable value with your own ffmpeg.exe path. | |
SET ffmpeg=%USERPROFILE%\Programs\JDownloader\tools\Windows\ffmpeg\x64\ffmpeg.exe | |
SET command=%ffmpeg% -i "%%f" -c:v libvpx-vp9 -b:v 0 -crf 30 -an -f webm -passlogfile "%TEMP%\ffmpeg2pass.log" | |
SET /P folder="Input directory path: " | |
rem Remove double quote from input string | |
SET folder=###%folder%### | |
SET folder=%folder:"###=% | |
SET folder=%folder:###"=% | |
SET folder=%folder:###=% | |
FOR %%f IN ("%folder%\*.gif") DO ( | |
%command% -pass 1 -y NUL && %command% -pass 2 "%%~nf.webm" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment