Skip to content

Instantly share code, notes, and snippets.

@laurentheirendt
Forked from XueshiQiao/gource.sh
Last active Feb 11, 2019
Embed
What would you like to do?
Generate a MP4 Video for your Git project commits using Gource!
# https://github.com/acaudwell/Gource
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
# 3.generate a video for you repo.
$ cd your_repo_dir
$ gource \
-s .06 \
-800x800 \
--auto-skip-seconds .1 \
--multi-sampling \
--highlight-users \
--hide mouse,progress,filenames,dirnames,users,usernames \
--file-idle-time 0 \
--max-files 0 \
--background-colour 000000 \
--font-size 22 \
--output-ppm-stream - \
--output-framerate 30 \
--dir-name-depth 9999 \
| avconv -y -r 30 -f image2pipe -vcodec ppm -i - -b 65536K movie.mp4
# generate a gif
$ gource \
-s .06 \
-500x500 \
--auto-skip-seconds .1 \
--multi-sampling \
--stop-at-end \
--start-date '2016-03-01' \
--hide date,mouse,progress,filenames,dirnames,users,usernames \
--file-idle-time 0 \
--max-files 0 \
--background-colour 000000 \
--font-size 22 \
--output-ppm-stream - \
--output-framerate 30 \
--dir-name-depth 9999 \
| ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 input.mp4
# convert the video to individual frames
$ mkdir frames
$ ffmpeg -i input.mp4 -vf scale=400:-1:flags=lanczos,fps=10 frames/ffout%03d.png
$ convert -loop 0 frames/ffout*.png output.gif
# remove the folder of frames
$ rm -rf frames
# presentation DOE
$ gource \
-s .06 \
-500x500 \
--auto-skip-seconds .1 \
--multi-sampling \
--stop-date '2014-10-15' \
--highlight-users \
--hide mouse,progress,filenames,dirnames,users,usernames \
--file-idle-time 0 \
--max-files 0 \
--background-colour 000000 \
--font-size 22 \
--output-ppm-stream - \
--output-framerate 30 \
--dir-name-depth 9999 \
| avconv -y -r 30 -f image2pipe -vcodec ppm -i - -b 65536K movie.mp4
$ gource \
--disable-auto-skip \
-500x500 \
--seconds-per-day 1 \
--c 4.0 \
--multi-sampling \
--stop-at-end \
--highlight-users \
--hide mouse,progress,filenames,dirnames,users,usernames \
--file-idle-time 0 \
--max-files 0 \
--font-size 22 \
--background-colour 000000 \
--output-ppm-stream - \
--output-framerate 30 \
--dir-name-depth 9999 \
| avconv -y -r 30 -f image2pipe -vcodec ppm -i - -b 65536K movie.mp4
# convert the video to individual frames
$ mkdir frames
$ ffmpeg -i input.mp4 -vf scale=400:-1:flags=lanczos,fps=10 frames/ffout%03d.png
$ convert -loop 0 frames/ffout*.png output.gif
# remove the folder of frames
$ rm -rf frames
# video for leaddbs/pacer
$ gource \
-s .06 \
-1280x720 \
--auto-skip-seconds .1 \
--multi-sampling \
--highlight-users \
--hide mouse,progress,filenames \
--file-idle-time 0 \
--max-files 0 \
--background-colour 000000 \
--font-size 22 \
--output-ppm-stream - \
--output-framerate 30 \
--dir-name-depth 9999 \
| avconv -y -r 30 -f image2pipe -vcodec ppm -i - -b 65536K movie.mp4
# gif for leaddbs/pacer
gource \
-s .06 \
-500x500 \
--auto-skip-seconds .1 \
--multi-sampling \
--stop-at-end \
--hide date,mouse,progress,filenames,dirnames,users,usernames \
--file-idle-time 0 \
--max-files 0 \
--background-colour 000000 \
--font-size 22 \
--output-ppm-stream - \
--output-framerate 30 \
--dir-name-depth 9999 \
| ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 input.mp4
# convert the video to individual frames
$ mkdir frames && ffmpeg -i input.mp4 -vf scale=400:-1:flags=lanczos,fps=10 frames/ffout%03d.png
$ convert -loop 0 frames/ffout*.png output.gif
# remove the folder of frames
$ rm -rf frames
# It's Done! Just share the video with your teammates, Have fun!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment