Last active
June 2, 2020 23:21
-
-
Save ketiko/a5aa0f9f0ac225eeaa3ebfda620db6a9 to your computer and use it in GitHub Desktop.
Convert a gif to a zoom mp4 file
This file contains 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
#!/bin/sh | |
set -eo pipefail | |
IFS=$'\n\t' | |
GIF_URL=$1 | |
TMP_GIF=$(mktemp) | |
TMP_GIF="$TMP_GIF.gif" | |
TMP_VID=$(mktemp) | |
TMP_VID="$TMP_VID.mp4" | |
function cleanup() { | |
rm $TMP_GIF | |
rm $TMP_VID | |
} | |
trap cleanup EXIT | |
wget -q -O $TMP_GIF $GIF_URL | |
ffmpeg -v 0 -i $TMP_GIF -movflags faststart -pix_fmt yuv420p -vf "scale=640:360" $TMP_VID | |
ffmpeg -v 0 -i $TMP_VID -vf hflip -c:a copy -y zoom_gif.mp4 | |
echo "Created zoom_gif.mp4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment