Last active
August 6, 2020 11:12
-
-
Save markhalliwell/39f4f19a287ce9d439baab45f8c26ac6 to your computer and use it in GitHub Desktop.
Drupal Bootstrap Gource (https://www.youtube.com/watch?v=Cvq6MPJp2dI)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
[ ! -d .git ] && "This is not a git directory." && exit 1 | |
# Setup the gource info for the repo. | |
~/gource/setup | |
# Create the video. | |
gource --load-config ./.git/gource/config.ini | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 8 -bf 0 ./gource.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
#fetch Gravatars (from https://github.com/acaudwell/Gource/wiki/Gravatar-Example) | |
use Cwd; | |
use strict; | |
use warnings; | |
use LWP::Simple; | |
use Digest::MD5 qw(md5_hex); | |
my $size = 300; | |
my $git_dir = cwd() . '/.git'; | |
die("no .git/ directory found in current path\n") unless -d "$git_dir"; | |
my $gource_dir = "$git_dir/gource"; | |
mkdir($gource_dir) unless -d "$gource_dir"; | |
my $output_dir = "$gource_dir/avatar"; | |
mkdir($output_dir) unless -d "$output_dir"; | |
open(GITLOG, q/git log --pretty=format:"%ae|%an" |/) or die("failed to read git-log: $!\n"); | |
my %processed_authors; | |
while(<GITLOG>) { | |
chomp; | |
my($email, $author) = split(/\|/, $_); | |
# Skip authors we've already processed. | |
next if $processed_authors{$author}++; | |
print "Fetching avatar image for \"$author\" - "; | |
# Skip images we already have. | |
my $author_image_file = "$output_dir/$author.png"; | |
if (-e "$author_image_file") { | |
print "done!\n"; | |
next; | |
} | |
#try and fetch image | |
my $grav_url = "http://www.gravatar.com/avatar/" . md5_hex(lc $email) . "?d=404&size=$size"; | |
my $rc = getstore("$grav_url", "$author_image_file"); | |
if ($rc == 200) { | |
print "done!"; | |
} | |
else { | |
unlink($author_image_file); | |
print "doesn't exist!"; | |
} | |
print "\n"; | |
} | |
close GITLOG; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
[ ! -d .git ] && "This is not a git directory." && exit 1 | |
[ ! -d .git/gource ] && mkdir .git/gource | |
~/gource/gravatar.pl | |
git tag -l | while read tag; do git log -1 --pretty=format:"%at|$tag%n" $tag ;done | cat > .git/gource/captions.txt | |
( | |
cat <<EOF | |
[display] | |
multi-sampling=true | |
output-ppm-stream=- | |
viewport=1280x720 | |
[gource] | |
auto-skip-seconds=0.25 | |
background-colour=0000FF | |
caption-duration=1 | |
caption-file=.git/gource/captions.txt | |
date-format=%Y-%m-%d | |
file-idle-time=0 | |
git-branch=8.x-3.x | |
hide=progress,filenames,mouse | |
max-file-lag=0.1 | |
seconds-per-day=0.1 | |
title=Drupal Bootstrap (https://www.drupal.org/project/bootstrap) | |
user-friction=1 | |
user-image-dir=.git/gource/avatar/ | |
EOF | |
) > .git/gource/config.ini; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requirements (macOS):
brew install gource
brew install ffmpeg
Installation:
gource
in your home directory and save all 3 above files in there.setup.sh
to match your project (this is currently setup for the 8.x-3.x branch of https://www.drupal.org/project/bootstrap)Gource creation:
~/gource/setup.sh
(this step is important as it will install the gource configuration into the project's.git
directory)~/gource/create.sh
(will take a while depending on how big the repo is and how fast your computer is)Once completed there should be a new file in your project root named
gource.mp4
.Post-production:
gource.mp4
and import into iMovie (or similar video editing program).gource.mp4
clip (https://filmora.wondershare.com/imovie/imovie-green-screen-effect.html#part2 or https://blogs.cofc.edu/tlttutorials/2015/10/21/changing-your-videos-background-in-imovie/)