Skip to content

Instantly share code, notes, and snippets.

@nickbrowne
Created February 5, 2016 06:03
Show Gist options
  • Save nickbrowne/02ace7258b5e9ddd872c to your computer and use it in GitHub Desktop.
Save nickbrowne/02ace7258b5e9ddd872c to your computer and use it in GitHub Desktop.
a quick and dirty video to gif converter
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
def filename
ARGV[0].rpartition('.').first
end
`ffmpeg -i #{ARGV[0]} -vf scale=320:-1 -f image2pipe -vcodec ppm - | convert -layers Optimize -delay 5 -loop 0 - #{filename}.gif`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment