I Never Record Code Reviews Anymore — My Rust Tool Turns Any Git Diff Into a Video
Source: Dev.to
Code reviews are the most text‑heavy part of software development. Walls of green and red. Inline comments. “LGTM” after skimming 400 lines.
What if you could watch a code review instead of reading it?
The Problem Nobody Talks About
Async code reviews lose context. You’re staring at a diff, jumping between files, trying to reconstruct the story of the change. Why was this deleted? What does this new function connect to?
Video walkthroughs solve this. Senior engineers record Loom videos walking through PRs all the time, but recording takes 10× longer than writing comments. You have to:
- Open a screen recorder
- Navigate to each file
- Talk through every change
- Edit out the “uh”s and wrong tabs
- Upload and share
Nobody does this for every PR, so we’re stuck with text diffs.
One Command. Animated Walkthrough.
patchcast --diff HEAD~1 -o review.mp4PR URL in, MP4 out.
patchcast reads any git diff — commit ranges, branch comparisons, .diff files — and generates an animated code walkthrough video with real syntax highlighting, smooth transitions, and a professional dark‑theme aesthetic. No recording. No narration. No editing. The diff is the video.
How the Animation Works
Each file in the diff becomes a scene. The animation follows a deliberate sequence designed for readability:
- Title Card (1 s) – Filename, language, change stats (+N/‑N).
- Code Reveal – Lines appear progressively with full syntax highlighting (real parsed syntax via syntect, supporting 30+ languages).
- Deletion Highlight – Removed lines pulse red and fade out.
- Addition Highlight – New lines slide in with a green highlight, then normalize.
- Pause (0.5 s) – Hold the final state so you can actually read it.
- Crossfade (0.5 s) – Smooth transition to the next file.
Title Card → Code Reveal → Deletions (red) → Additions (green) → Pause → Crossfade → Next FileThe result: a video that tells the story of a change, file by file, in a logical order.
Real Commands
# Review your last commit
patchcast --diff HEAD~1 -o review.mp4
# Compare branches (perfect for PR walkthroughs)
patchcast --diff main..feature-branch -o pr.mp4
# Use a diff file with a custom theme
patchcast --file changes.diff --theme "Solarized (dark)" -o styled.mp4
# Full customization
patchcast --diff HEAD~1 \
--theme "Solarized (dark)" \
--font-size 18 \
--fps 30 \
--width 1920 --height 1080 \
-o review.mp4
# Pipe from git
git diff main | patchcast --file /dev/stdin -o out.mp4Where This Actually Gets Used
- Async code reviews – Drop a video in the PR thread. Reviewers watch the change unfold instead of scrolling a diff. Context survives the async gap.
- Onboarding – New engineers can watch videos of the last 10 meaningful PRs to see the codebase evolve.
- Tech talks and demos – Need to show a refactor in a presentation? One command, polished video. No screen recording, no “let me zoom in on this part.”
- Documentation – Embed walkthrough videos in architecture docs to illustrate how the system changed.
- Blog posts – Generate a video of the actual code change instead of pasting static snippets.
Under the Hood
patchcast is written in Rust. The pipeline is straightforward:
diff input → parse → syntax highlight → scene generation → frame rendering → ffmpeg → MP4Core Modules
- diff_parser.rs – Parses unified diff format into structured hunks.
- highlighter.rs – Syntect‑based syntax highlighting for 30+ languages.
- scene.rs – Converts parsed diffs into animation scenes with timing.
- animation.rs – Easing functions, interpolation, timing curves.
- renderer.rs – Renders frames using the
imagecrate, pipes to ffmpeg. - style.rs – Dark theme (Catppuccin Mocha inspired), color constants.
The syntax highlighting is real — not regex‑based approximation. Syntect uses the same .sublime‑syntax definitions that power Sublime Text and bat. Rust, Python, JavaScript, TypeScript, Go, Java, C++, Ruby, Swift, and 20+ more languages are highlighted correctly out of the box.
59 tests cover the full pipeline from diff parsing to frame generation.
Why Rust?
Frame rendering is CPU‑intensive. Each frame is a pixel buffer that needs text layout, color blending, and composition. Rust makes this fast without a garbage‑collector pause mid‑render. A typical 5‑file diff renders in seconds.
- The
imagecrate handles pixel‑level rendering. git2(libgit2 bindings) reads the repository directly — no shelling out togit.syntectprovides the highlighting.ffmpeghandles the final encoding.
Try It
git clone https://github.com/LakshmiSravyaVedantham/patchcast
cd patchcast
cargo install --path .Prerequisites: Rust 1.70+, ffmpeg
- macOS:
brew install ffmpeg - Ubuntu:
apt install ffmpeg
Then point it at any repo:
cd your-project
patchcast --diff HEAD~1 -o walkthrough.mp4Star the repo if this is useful:
Code reviews shouldn’t require a recording studio. They should require one command.