Skip to content

Instantly share code, notes, and snippets.

@camilonova
Last active April 18, 2018 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camilonova/682e1e858391937d97b8afe4c0e76328 to your computer and use it in GitHub Desktop.
Save camilonova/682e1e858391937d97b8afe4c0e76328 to your computer and use it in GitHub Desktop.
Create a video using Gource
  1. Generar video:

gource -1920x1080 --title "Osaki" --logo axiacore-logo-small.png --user-image-dir .git/avatar/ --font-size 18 --seconds-per-day 0.3 --auto-skip-seconds 0.1 --disable-progress --stop-at-end -output-ppm-stream - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 video.mp4

gource -1920x1080 --title "Osaki" --logo axiacore-logo-small.png --user-image-dir .git/avatar/ --auto-skip-seconds 1 --seconds-per-day 0.5 --hide mouse,progress -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource.mp4

  1. Pista de audio

Editar audio en audacity y exportarlo a mp3 con la misma duración del video (maximo 90 segundos)

  1. Unir archivos y subir a youtube

$ ffmpeg -i audio.mp3 -i video.mp4 gource.mp4 -shortest

#!/usr/bin/perl
#fetch Gravatars
use strict;
use warnings;
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
my $size = 90;
my $output_dir = '.git/avatar';
die("no .git/ directory found in current path\n") unless -d '.git';
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(/\|/, $_);
next if $processed_authors{$author}++;
my $author_image_file = $output_dir . '/' . $author . '.png';
#skip images we have
next if -e $author_image_file;
#try and fetch image
my $grav_url = "http://www.gravatar.com/avatar/".md5_hex(lc $email)."?d=404&size=".$size;
warn "fetching image for '$author' $email ($grav_url)...\n";
my $rc = getstore($grav_url, $author_image_file);
sleep(1);
if($rc != 200) {
unlink($author_image_file);
next;
}
}
close GITLOG;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment