1 Star 0 Fork 5

hucheng27/BAT_FFMPEG

forked from jingcheng/BAT_FFMPEG 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Video-ToGIF_32ColorsStyle_240p.bat 2.00 KB
一键复制 编辑 原始数据 按行查看 历史
KnightDanila 提交于 2019-04-12 21:49 . Updates - Gif new resolutions :bird:
REM https://medium.com/@colten_jackson/doing-the-gif-thing-on-debian-82b9760a8483
REM http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
REM https://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality
REM https://gist.github.com/keijiro/b46d94f4cd1b159c59a72cd616f95017
REM https://superuser.com/questions/1231645/ffmpeg-generate-and-use-different-palette-for-every-frame
@echo off
echo %CD%
echo %~dp0
cd /d %~dp0
ECHO. & ECHO ******* BAT FILE *******
ECHO %~nx0
ECHO ************************ & ECHO.
REM For first file
REM %1
REM For multiple files
echo %*
set COUNTER=0
for %%x in (%*) do (
echo %%x
set /A COUNTER+=1
)
echo COUNTER = %COUNTER%
if %COUNTER% GTR 0 (
if %COUNTER% EQU 1 (
echo _____GET ONE FILE_____
) else (
echo _____GET MULTI FILES: %COUNTER% files_____
)
for %%x in (%*) do (
REM //////////////////// MAIN \\\\\\\\\\\\\\\\\\\\\\\\\
REM For Full File (create palette.png - "Video-ToGIF_palette.png", then create gif - I am happy)
ffmpeg.exe -i %%x -vf fps=30,scale=-1:240:flags=lanczos,palettegen=max_colors=32 Video-ToGIF_palette.png -y
ffmpeg.exe -i %%x -i Video-ToGIF_palette.png -filter_complex "fps=10,scale=-1:240:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=5" "%%~nx_Output_32ColorsStyle_240p.gif"
REM TESTs
REM ffmpeg.exe -ss 00:19:07 -t 1.3 -i %%x -vf fps=15,scale=320:-1:flags=lanczos,palettegen Video-ToGIF_palette.png -y
REM ffmpeg.exe -ss 00:19:07 -t 1.3 -i %%x -i Video-ToGIF_palette.png -filter_complex "fps=15,scale=400:-1:flags=lanczos[x];[x][1:v] paletteuse" "%%~nx_output.gif"
REM (create palette.png - "Video-ToGIF_palette.png", then create gif - I am happy)
REM ffmpeg.exe -ss 00:19:07 -t 1.3 -i %%x -vf fps=15,scale=-1:-1:flags=lanczos,palettegen Video-ToGIF_palette.png -y
REM ffmpeg.exe -ss 00:19:07 -t 1.3 -i %%x -i Video-ToGIF_palette.png -filter_complex "fps=15,scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse" "%%~nx_output_16Bit.gif"
)
) else (
echo _____GET NO ONE FILES_____
)
pause
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/hucheng27/BAT_FFMPEG.git
git@gitee.com:hucheng27/BAT_FFMPEG.git
hucheng27
BAT_FFMPEG
BAT_FFMPEG
master

搜索帮助