Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for animated gif capturing (Mac only via wacaw) #108

Merged
merged 1 commit into from Jul 23, 2013
Merged

Add option for animated gif capturing (Mac only via wacaw) #108

merged 1 commit into from Jul 23, 2013

Conversation

matthutchinson
Copy link
Member

Using wacaw and ffmpeg (and ImageMagick's convert) it is possible to generate and annotate a short animated gif for your lolcommit.

Use -a 3 or --animate=3 option in your .git/hooks/post-commit call to capture and animate (for 3 second gif) OR set the LOLCOMMITS_ANIMATE environment variable

Some extra points to note;

  • currently mac only
  • the longer the time, the larger the animated gif file-size
  • if LOLCOMMITS_ANIMATE is not set (or set at 0) - lolcommits will operate as normal
  • defaults to a 320x240 sized animated gif (reasonable dimensions to keep file-size down)
  • more info on wacaw is available here; http://webcam-tools.sourceforge.net

I've tested with a few of the plugins and it appears to work OK! Also I updated the README.md with instructions on how to enable and configure.

Any issues let me know. I'm happy to answer any questions, or improve the PR in any way. I'll probably blog about my adventures with this here sometime soon.

Thanks,

Matt

Ps.. I also submitted this forking PR allowing users to fork the capturing process (which is much slower on animated gif generation)

Ps.. The obligatory dramatic animated gif example from this commit 📺 😄

4988972a8d6

@mroth
Copy link
Member

mroth commented Jul 8, 2013

This is pretty amazing. 🎥 Targetting v0.5 milestone for this. It adds a lot of potential complexity to lolcommits (e.g. different functionality on different platforms) so I want to make sure we get it pretty tight and with good test coverage since lolcommits is used on so many different platforms these days and it's getting harder to prevent regressions.

Some things I can think of offhand that would help get this ready:

  • make --animate option only show up in --help documentation on platforms where it is supported (with Aruba tests to verify, should be simple enough to override via Lolcommits::Configuration.platform or somesuch to test)
  • have --animate fail gracefully with friendly error if ffmpeg not present (with Aruba tests to verify, I believe the existing @fake-no-imagemagick Cucumber tag will provide the proper environment for this?)
  • add wacaw binary to permission tests in test_lolcommits.rb (as git doesnt perserve file permissions, but if the gem for rubygems is built with the wrong file permissions it will fail, this test is to prevent us from accidentally releasing a broken build as ruby gem, see the trail of tears in issue ImageMagick Error on commit (OSX) #53 for details)
  • add animated GIF example screenshot to readme :-)

Thanks for all the hard work on this already! (and nice blog post)

@matthutchinson
Copy link
Member Author

Sorry for the delay, will aim to address these issues this weekend at some point.

Using wacaw and ffmpeg (and convert) it is possible to generate and annotate a
short animated gif for your lolcommit.  Use -a 3 or --animate=3 option in your
.git/hooks/post-commit call to capture and animate (for 3 second gif) The longer
the time, the larger the animated gif file-size. Some extra points to note;

* currently mac only
* if -a 0 (or not present) lolcommits will operate as normal
* defaults to a 320x240 sized animated gif
* wacaw is open source here; http://webcam-tools.sourceforge.net

I've tested with a few of the plugins and it appears to work OK! Also updated
README.md with instructions on how to enable and configure
@matthutchinson
Copy link
Member Author

Ok, I think I've been able to address all these points now. I rebased with latest master and pushed, all tests are green 💚 for me (with the exception of the unimplemented --fork test step, which I've fixed and improved in the other PR (#110)

I've refactored some of the path changing code in features/support/env.rb to module allowing you to specify which command to look for in path rejecting.

Also added a test that actually does an animated capture and checks the tmp folders and files are removed OK.

Any issues, questions etc. let me know.

@mroth
Copy link
Member

mroth commented Jul 23, 2013

This looks fantastic.

mroth added a commit that referenced this pull request Jul 23, 2013
Add option for animated gif capturing (Mac only via wacaw)
@mroth mroth merged commit ba10c5f into lolcommits:master Jul 23, 2013
@matthutchinson
Copy link
Member Author

Woohoo! :shipit: 🎥

Thanks for merging this in!

@matthutchinson matthutchinson deleted the animated-gif-lolcommits branch July 23, 2013 08:21
@matthutchinson
Copy link
Member Author

Hmm, the TravisCI build may be failing now since the check for ffmpeg dependency now exists ... Is there anyway to tell TravisCI to have that installed for test runs?

@mroth
Copy link
Member

mroth commented Jul 23, 2013

@matthutchinson yeah, if you look in the .travis.yml file there are pre-build instructions, we can add ffmpeg to the list of packages that are installed (travis boxes are ubuntu images iirc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants