Coder Social home page Coder Social logo

gifify's Introduction

gifify

gifify is a shell script for converting screen recordings into GIFs that can be embedded conveniently into places like Slack channels or GitHub issues and pull requests.

Installation

brew install gifify

Usage

Given a file recording.mov:

  • Convert it into recording.mov.gif:
gifify recording.mov
  • Convert it into new_gif.gif:
gifify -o new_gif recording.mov
  • Convert it, cropping the top left corner:
gifify -c 100:100 recording.mov
  • Convert it and output at 60 frames per second:
gifify -r 60 recording.mov
  • Convert it and output at 30 frames per second at 2x speed:
gifify -r 30@2 recording.mov
  • Convert it and output at 30 frames per second at 2x speed, with a single loop:
gifify -r 30@2 -l 1 recording.mov

Regarding framerates:

GIF renderers typically cap the framerate somewhere between 60 and 100 frames per second. If you choose to change the framerate or playback speed of your GIFs, ensure your framerates do not exceed 60 frames per second to ensure your GIFs play consistently. An easy way to compute this is to ensure that FPS x SPEED is not greater than 60.

License

MIT (See LICENSE)

gifify's People

Contributors

dmyers avatar hidde-jan avatar jclem avatar kirbysayshi avatar leoj3n avatar rockymadden avatar yukon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gifify's Issues

node-gifify

Hey hi @jclem following your great gifify, I made https://github.com/vvo/gifify.

It has some advantages on yours, mostly that everything happens in memory instead of using a temp file.

Also more options and I got rid of cloudapp thing.. What do you think?

Thoughts on interface cleanup

#11's README mentions made me wonder: are you, @jclem open, at some point, to a revamp of the flags? Some changes I've been thinking of making:

  • make -n the default behavior, or assume the command should be gifify file.mp4 | cloudup
  • remove the -o, assume user will redirect (maybe)?
  • merge -r and -s since they are dependent on each other, perhaps something like gifify -r 1.5@30 (1.5x speed, output at 30fps)

Maybe others?

2x playback docs are wrong

Following the readme, tried -r 20@2 and it failed:

   gifify -r 20@2 -p 640:-1 richcomment.mp4 
Exporting movie...
(standard_in) 1: illegal character: @
(standard_in) 1: parse error

Loop option

It would be nice to have an option that controls the looping of the output file.

Add support for filenames with spaces

For example gifify -r 60 -n My\ first\ recording.mov fails with:

convert: unable to open image `My\ first\ recording.mov': No such file or directory @ error/blob.c/OpenBlob/2657

Show progress?

Is it possible to show progress? Some conversions take quite a while and it's hard to tell if things are still ongoing.

Perform operations in memory

Writing and reading to/from the disk is slow. I would suggest performing operations over a pipe to improve performance:

ffmpeg -loglevel panic -i "$filename" $filter -r $fps -f image2pipe -vcodec ppm - | \
  convert +dither -layers Optimize -loop $loop -delay $delay - "${output}.gif"

Conditionally, we could allow data to be written to the disk to preserve memory.

Option to speed up framerate

I often want my mini-screencasts to move faster me, so would be great to have a flag that allows you to change the speed of the resulting GIF. Something like:

# speed up by 50%
gifify -s 1.5 my.mov

Do not upload to CloudApp by default

The default integration with cloudapp makes this tool much more specialized. I understand that many people will want to upload their created GIFs to share, but making that the default behavior, and especially only providing that single interface seems counterintuitive.

You've made a great CLI tool for creating GIFs from videos, and you would attract a much larger following and userbase if it did not come off as a specialty tool for creating GIFs from videos AND uploading them to CloudApp. It also adds one more dependency to get up and running with the default settings.

Wonderful tool and thank you so much for creating it, but I have no need to share GIFs, nor have I ever heard of CloudApp. I'm sure I am not alone in this stance :)

The integration is an awesome addition, I just wouldn't have it be the default behavior.

Add Scaling

I would like to be able to scale down the resolution/size/quality of the video so it doesn't stay so large.

The README should explain that ffmpeg & ImageMagick must be installed

Awesome! A simple way to finally convert videos to animated GIFs (or APNGs, by subtly changing a parameter or three), with few commands/arguments to remember and/or fine-tune!

While this is an amazingly clever usage of ffmpeg piped into ImageMagick, I think that you ought to update the README to explain that you need to have those two tools installed on your system. Oh, and that you need to have something installed that is able to understand sh-like shell script (not PowerShell!) — which should be the case in most Unix and Unix-like systems out there (including WSL).

Granted, for those in a Mac environment (or a Linux environment) using Homebrew, brew install gifify will immediately figure out those dependencies. But not everybody uses that; Ubuntu doesn't have it in their own package manager (just to give one example).

It's just a thought, really. The script works as intended — if you have all the requirements! — and is complete and perfect and will work "forever", or at least until either ffmpeg or convert change their list of parameters/arguments/commands... which is not very likely to happen in the next decade or two.

Hangs during gif conversion

Would love to use this script. Attempting to convert a small mov file and it just hangs on "making gif...". Any suggestions?

4/20 Update not available via homebrew?

Getting parse errors with the 30@2 syntax and seeing it still looking for CloudApp.

Desktop gifify -r 30@2 retry.mov
Exporting movie...
(standard_in) 1: illegal character: @
(standard_in) 1: parse error
Making gif...
convert: no images defined `retry.mov.gif' @ error/convert.c/ConvertImageCommand/3230.
Unable to find application named 'CloudApp'```

Don't display ffmpeg output

It's ugly, no one needs to see it in gifify context. More meaningful messages from gifify should be shown.

options to process a bunch of files

Pers aps it's out of scope, but would be useful to be able to process a bunch of files, in the current dir, or in a given directory. Indeed the workflow is generally (at least in my cases) to convert several files from video to git. O course, I can make my own shell stuff, but don't now how to do that, and would be integrated with gifify which is better :)

A problem that I would have is when I want to handle custom output names, for different files, there is no options to customize file name, depending of original file name, like appending always -S or -M ... to original file name ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.