Created
July 9, 2019 08:21
-
-
Save yoggy/acf1e5c9af4265ea3696c300088b98df to your computer and use it in GitHub Desktop.
早送りGIF動画作成バッチファイル。ffmpegを使用
This file contains hidden or 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 | |
rem conv_fastforward_gif.bat - 早送りGIF動画作成バッチファイル。ffmpegを使用。 | |
rem | |
rem 引数 : 入力動画 横サイズ フレームレート n倍速 | |
rem | |
call :GET_BASENAME %1% | |
set GIF_FILENAME=%RETVAL%.gif | |
echo %GIF_FILENAME% | |
ffmpeg -i %1 -vf "palettegen" -y palette.png | |
ffmpeg -i %1 -i palette.png -lavfi "fps=%3,scale=%2:-1:flags=lanczos,setpts=PTS/%4.0 [x]; [x][1:v] paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle" -y %GIF_FILENAME% | |
exit /b 0 | |
:GET_BASENAME | |
rem 入力引数 echo %1 | |
rem ドライブ名 echo %~d1 | |
rem パス echo %~p1 | |
rem ファイル名 echo %~n1 | |
rem 拡張子 echo %~x1 | |
set RETVAL=%~d1%~p1%~n1 | |
exit /b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment