Skip to content

Instantly share code, notes, and snippets.

@yoggy
Created July 9, 2019 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoggy/acf1e5c9af4265ea3696c300088b98df to your computer and use it in GitHub Desktop.
Save yoggy/acf1e5c9af4265ea3696c300088b98df to your computer and use it in GitHub Desktop.
早送りGIF動画作成バッチファイル。ffmpegを使用
@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