Skip to content

Instantly share code, notes, and snippets.

@arirusso
Created January 20, 2014 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arirusso/8516315 to your computer and use it in GitHub Desktop.
Save arirusso/8516315 to your computer and use it in GitHub Desktop.
Extract animated gif from mp4 video
input_file,
output_file,
start_time,
duration,
fps,
scale = *ARGV
options = "-ao null -nosound -vo gif89a:fps=#{fps}:output=#{output_file} -ss #{start_time} -endpos #{duration} -vf scale=#{scale}"
player_path = "/Applications/MPlayer OSX Extended.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/mpextended.mpBinaries/Contents/MacOS/mplayer"
`'#{player_path}' #{input_file} #{options}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment