jiangyver 当前离线
列兵
@echo off setlocal enabledelayedexpansion set ffmpegPath=D:\ffmpeg-master-latest-win64-gpl-shared\bin\ffmpeg.exe[quote]软件路径[/quote] set inputFolder=%~dp0 set outputFolder=%inputFolder%GIFs if not exist %outputFolder% mkdir %outputFolder% for %%i in (%inputFolder%.mp4) do ( echo Converting %%i... %ffmpegPath% -i %%i -ss 000000 -t 000500 -vf scale=320-1flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse %outputFolder%%%~ni.gif echo Converted %%i to %outputFolder%%%~ni.gif ) echo All MP4 files have been processed.复制代码
Five66 当前离线
上尉
scale=320-1flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse复制代码
"scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse[out]" -map "[out]"复制代码
TOP
fzp070 当前离线
三级士官
@echo off color 3f title FFmpeg批量视频转GIF setlocal enabledelayedexpansion set ffmpegPath=D:\ffmpeg-master-latest-win64-gpl-shared\bin\ffmpeg.exe&rem 软件路径 set inputFolder=%~dp0 set outputFolder=%inputFolder%GIFs if not exist "%outputFolder%" mkdir "%outputFolder%" for %%i in ("%inputFolder%*.mp4") do ( echo 转换【%%~ni.mp4】... if exist "%outputFolder%\%%~ni.gif" echo.&echo ---注:视频已有GIF文件,程序退出!--- &goto end "%ffmpegPath%" -i "%%i" -y -ss 000000 -t 000500 -vf scale=720:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse "%outputFolder%\%%~ni.gif">nul 2>nul echo.&echo 已转换 "%%~ni.mp4" to "%%~ni.gif" ) echo.&echo 所有 MP4 文件均已处理。 :end TIMEOUT /T 5 /NOBREAK exit复制代码