Skip to content

Instantly share code, notes, and snippets.

@RupGautam
Last active April 10, 2016 04:41
Show Gist options
  • Select an option

  • Save RupGautam/a8e9aec96dde5ccf4a6f to your computer and use it in GitHub Desktop.

Select an option

Save RupGautam/a8e9aec96dde5ccf4a6f to your computer and use it in GitHub Desktop.
Make gif from video file on OSX | makegif osx
#!/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
@RupGautam

Copy link
Copy Markdown
Author

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

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