Gource: Developers' Work Visualized

Do you already know Gource? It's a console tool to produce beautiful video animations out of your Git repository's commits. – I really do like Gource, because it's a nice way to visualize your work as a developer.

Gource: Developers' Work Visualized
Photo by kazuend / Unsplash

Do you already know Gource? It's a console tool to produce beautiful video animations – like the one below – out of your Git repository's commits.

0:00
/2:29

Development of the 'EduYou' app - visualized with Gource. Turn on your sound and enjoy the fireworks! 🎆 🎶 😎

💡
Insight: The video's soundtrack was created with Suno.

On its website, Gource is described as ...

[...] a software version control visualization tool [...] Software projects are displayed [...] as an animated tree with the root directory of the project at its centre. Directories appear as branches with files as leaves. Developers can be seen working on the tree at the times they contributed to the project.

I really do like Gource, not just because of the nice video outputs, but also because it's a nice way to visualize your work as a developer (or development team). As a backend developer, it's not always obviously visible (especially for stakeholders) how much work you do in the codebase. Gource helps to make that more visible.

How to Make a Gource Video?

Please be aware that Gource ...

[just] creates an uncompressed sequence of screenshots in PPM format which can then be processed by a video encoder (such as ffmpeg) to produce a video.

Therefore, you need to use FFmpeg to convert that Gource output into an actual video format. – Depending upon your specific requirements, you have certain command options available. The following command combinations worked for me (to produce the above Gource video). (If you need to apply some changes, I've found that ChatGPT provides good enough proposals for these commands.)

Make AVI File

  • $ gource -2560x1440 --auto-skip-seconds 0.1 --logo ".\EduYou_Logo_farbe.png" --title "Development of the 'EduYou' app - visualized with Gource." --date-format "%B %Y" --font-size 40 --hide "dirnames,filenames,users" -o gource.ppm --seconds-per-day 0.5
  • $ ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i gource.ppm -vcodec libx264 -preset medium -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource.x264.avi

Make WebM file

  • $ gource command here is the same as above.
  • $ ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i gource.ppm -vcodec libvpx -b 10000K gource.webm

Make WebM file (Incl. Audio)

  • $ gource command here is the same as above.
  • $ ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i gource.ppm -i ".\EduYou - For All Career Steps!.mp3" -filter_complex "[0:v]setpts=(149/182)*PTS[v];[v][1:a]concat=n=1:v=1:a=1[v][a]" -map "[v]" -map "[a]" -vcodec libvpx -b:v 2M -crf 30 -b:a 192k -shortest gource_with_audio.webm
💡
Tip: The ffmpeg command here produces a WebM file, where the resulting video is adjusted to the length of the provided audio file. – To achieve this, the setpts=(149/182)*PTS expression adjusts the playback speed of the video by multiplying the presentation timestamps (PTS) by (149/182). This effectively speeds up the video to match the audio duration, where 149 represents the desired duration and 182 the original duration. (Meaning: 182 seconds is the video duration of our WebM file without audio, whereas 149 seconds is the length of the MP3 file.)

References and further reading:

  1. Gource Homepage
  2. Gource GitHub Repo: Using Gource
  3. Gource GitHub Repo: Create a video
  4. Gource GitHub Repo: Visualizing Multiple Repositories

🎓
Invitation: If you're curious, feel free to check out our EduYou app as well. – EduYou is a platform for lifelong learning, career advice and managing your job applications. – Note: As of Oct. 2024, the web app isn't fully translated yet. German is fully supported. Unfortunately, other languages like English, French, Italian, Spanish and Turkish only partially. That is supposed to change over the upcoming sprints.

Share this post: