Last active
April 10, 2016 04:41
-
-
Save RupGautam/a8e9aec96dde5ccf4a6f to your computer and use it in GitHub Desktop.
Make gif from video file on OSX | makegif osx
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
| #!/bin/sh | |
| #Thank you @http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html | |
| #TODO: - Decrease the output size, right now it is 8MB on 5 secs MP4 videos. | |
| # - Use convert to decrease size?? | |
| palette="/tmp/palette.png" | |
| filters="fps=10,scale=720:-1:flags=lanczos" | |
| ffmpeg -v warning -ss $1 -t $2 -i $3 -vf "$filters,palettegen" -y $palette | |
| ffmpeg -v warning -ss $1 -t $2 -i $3 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $4 | |
| # Example usage: ./makegif.sh "video_from_value" "video_to_value" "input_video_file" "output_value_name.gif" | |
| # ./makegif.sh 00 05 soccer.mp4 wow_goal.gif |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example usage:
./makegif.sh "video_from_value" "video_to_value" "input_video_file" "output_value_name.gif"