From 3aeeae548a3e4536318c0f07fae35491772d672c Mon Sep 17 00:00:00 2001 From: hesam-init Date: Sat, 24 Feb 2024 02:06:19 +0330 Subject: [PATCH] feat: convert video to gif function --- dots/zsh/.zsh_custom/functions.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dots/zsh/.zsh_custom/functions.zsh b/dots/zsh/.zsh_custom/functions.zsh index 8b13789..a0ba479 100644 --- a/dots/zsh/.zsh_custom/functions.zsh +++ b/dots/zsh/.zsh_custom/functions.zsh @@ -1 +1,8 @@ +convert_video_to_gif() { + local input_video="$1" + local output_filename="output_$(date +"%Y%m%d%H%M%S").gif" + ffmpeg -i "$input_video" -vf "fps=30,scale=1920:-1:flags=lanczos" -c:v gif "$output_filename" + + echo "GIF created: $output_filename" +}