本帖最后由 523066680 于 2019-6-5 17:58 编辑
没写完,有要事处理。楼主也找到了其他有现成代码的。
不过楼主还是好心说要付一些,我说捐论坛吧~
已写的部分和参考资料 | @echo off &setlocal enabledelayedexpansion | | set path=.\;%path% | | set "video=test.vob" | | ffmpeg -i %video% 2>info.txt | | | | for /f "tokens=2,3,4 delims=.:, " %%a in ('type info.txt ^|find "Duration"') do ( | | echo %%a:%%b:%%c | | set /a hour=%%a, min=%%b, sec=%%c, len=%%a*3600+%%b*60+%%c, last=len-15-10 | | ) | | | | set palette=palette.png | | :: gen palette | | ffmpeg -i %video% -vf palettegen -y %palette% | | | | :: now convert | | for /l %%a in (10, 10, %last%) do ( | | ffmpeg -y -i "%video%" -i %palette% -lavfi paletteuse -y -ss %%a -t 10 -r 10 "%video%_%%a.gif" | | ) | | pauseCOPY |
关于 ffmpeg 转 gif 画面质量保真,参考
https://superuser.com/questions/ ... -reasonable-quality
另一种是 先 FFmpeg 逐段拆 png,再用 image::magick 转gif
https://www.cnblogs.com/nlsoft/p/3433199.html |