Skip to content

Instantly share code, notes, and snippets.

@garrytrinder
Last active September 18, 2020 19:56
Show Gist options
  • Save garrytrinder/3aa8469b82d87ce473d1836261fba732 to your computer and use it in GitHub Desktop.
Save garrytrinder/3aa8469b82d87ce473d1836261fba732 to your computer and use it in GitHub Desktop.
Converts the given GIFs to MP4 and WEBM
#!/usr/bin/env zsh
path='../public/img/managedidentity'
files=(
"${path}/configure-logic-app"
"${path}/create-logic-app"
"${path}/enable-managed-identity"
"${path}/grant-microsoft-graph-permission"
"${path}/run-logic-app"
"${path}/view-managed-identity-service-principal"
)
for file in "${files[@]}"; do
echo "$file"
$(/usr/local/Cellar/ffmpeg/4.3.1_1/bin/ffmpeg -loglevel quiet -an -i "$file.gif" -vcodec h264 -strict -2 -pix_fmt yuv420p "$file.mp4" -y)
$(/usr/local/Cellar/ffmpeg/4.3.1_1/bin/ffmpeg -loglevel quiet -an -i "$file.gif" -c vp9 -b:v 0 -crf 41 "$file.webm" -y)
done
@garrytrinder
Copy link
Author

Updated MP4 conversion to support QuickTime ensuring that MP4s now work in Safari and iOS.
Added -an flag to ignore audio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment