Created
April 11, 2022 18:01
-
-
Save jewelsjacobs/956798a0702fa9f8de7dfdbb6fd8368e to your computer and use it in GitHub Desktop.
[Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal] #mov #gif #bash #shell
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 characters
# https://gist.github.com/SheldonWangRJT/8d3f44a35c8d1386a396b9b49b43c385 | |
# https://www.youtube.com/watch?v=QKtRMFvvDL0 | |
# $brew install ffmpeg | |
# $brew install gifsicle | |
# 1. Convert the file to gif using ffmpeg | |
# - input path argument `-i` | |
# - pixel format argument `-pix_fmt` | |
# - removing some frames using framerate argument `-r` | |
# - end `ffmpeg` with new path/to/filename | |
# 2. Optimize the same output file with third option -O3 | |
# and rewrite the generated gif file from last step | |
# 3. Notes: using && to make sure the conversion sucess before optimizing | |
ffmpeg -i in.mov -pix_fmt rgb8 -r 10 output.gif && gifsicle -O3 output.gif -o output.gif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment