Turn Your Git History into a Stunning Video with Gource and Avconv
This guide shows how to install Gource and Avconv, configure Chinese font support, and use a series of command‑line options to transform any Git repository’s commit history into a high‑resolution video, optionally adding background music for a polished visual celebration of your project.
Talk is cheap, show me the code. Inspired by the popularity of alibaba/x-render , this tutorial demonstrates how to create a celebratory video of a Git repository using gource for log visualization and avconv for video processing.
Step 1: Install Gource and Avconv
Install the required tools via Homebrew (use a Chinese mirror if the default source is slow):
brew install gource
brew install libav # avconv is similar to ffmpegEnable Chinese font support for Gource by replacing the default font:
rm /usr/local/var/homebrew/linked/gource/share/gource/fonts/FreeSans.ttf
ln -s /System/Library/Fonts/Hiragino\ Sans\ GB.ttc /usr/local/var/homebrew/linked/gource/share/gource/fonts/FreeSans.ttfStep 2: Generate the Visualization Video
Navigate to the root of any Git‑managed project and run the following command. It configures titles, colors, fonts, speeds, and streams the frames directly to avconv to produce an MP4 video.
gource \
--title "Your Title" \
--seconds-per-day 0.15 \
-1920x1080 \
--multi-sampling \
--background-colour 000000 \
--dir-colour 62C454 \
--file-font-size 12 \
--font-size 24 \
--dir-font-size 14 \
--user-font-size 18 \
--auto-skip-seconds 0.2 \
--stop-at-end \
--hide mouse \
--highlight-users \
--highlight-dirs \
--file-extension-fallback \
--file-idle-time 0 \
--max-user-speed 200 \
--filename-time 2 \
--highlight-colour F5BE4F \
--date-format "%Y-%m-%d" \
--output-framerate 60 \
--output-ppm-stream - \
| avconv -y -r 60 -f image2pipe -vcodec ppm -i - -b 65536K movie.mp4Step 3: Add Background Music
Place an audio file (e.g., sound.mp3) in the project root and merge it with the video:
avconv -i movie.mp4 -i sound.mp3 -map 0 -map 1:a -c:v copy -shortest output.mp4Step 4: Apply to Any Git Project
The same process works for any Git log, whether it’s an open‑source repository or your own work code.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
