Last active
January 12, 2023 13:35
-
-
Save Olshansk/8046a7bfff7c82aca67d961d4d3d1d1a to your computer and use it in GitHub Desktop.
Revisions
-
Olshansk revised this gist
Jan 11, 2023 . No changes.There are no files selected for viewing
-
Olshansk created this gist
Jan 11, 2023 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ function video_to_gif { local input_video_path="$1" local output_gif_path="$2" local fps="${3:-10}" local scale="${4:-1080}" local loop="${5:-0}" ffmpeg -i "${input_video_path}" -vf "setpts=PTS/1,fps=${fps},scale=${scale}:-2:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop $loop "${output_gif_path}" }