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

Merged
merged 1 commit into from Jul 23, 2013

Projects

None yet

2 participants

@matthutchinson
Collaborator

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
Owner
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 #53 for details)
  • add animated GIF example screenshot to readme :-)

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

@matthutchinson
Collaborator

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

@matthutchinson matthutchinson adding options for animated gif capturing (Mac only via wacaw)
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
7588f4a
@matthutchinson
Collaborator

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
Owner
mroth commented Jul 23, 2013

This looks fantastic.

@mroth mroth merged commit ba10c5f into mroth:master Jul 23, 2013

1 check failed

default The Travis CI build failed
Details
@matthutchinson
Collaborator

Woohoo! :shipit: ๐ŸŽฅ

Thanks for merging this in!

@matthutchinson matthutchinson deleted the unknown repository branch Jul 23, 2013
@matthutchinson
Collaborator

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
Owner
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