DEV Community

Lakshmi Sravya Vedantham
Lakshmi Sravya Vedantham

Posted on

I Never Record Code Reviews Anymore — My Rust Tool Turns Any Git Diff Into a Video

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 10x 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.mp4
Enter fullscreen mode Exit fullscreen mode

That's it. PR 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:

1. Title Card (1s) — Filename, language, change stats (+N/-N). You immediately know what file you're looking at and how big the change is.

2. Code Reveal — Lines appear progressively with full syntax highlighting. Not a screenshot — real parsed syntax via syntect, supporting 30+ languages.

3. Deletion Highlight — Removed lines pulse red and fade out. Your eye is drawn exactly where code was removed.

4. Addition Highlight — New lines slide in with a green highlight, then normalize. The visual weight tells you "this is what matters."

5. Pause (0.5s) — Hold the final state so you can actually read it.

6. Crossfade (0.5s) — Smooth transition to the next file.

Title Card → Code Reveal → Deletions (red) → Additions (green) → Pause → Crossfade → Next File
Enter fullscreen mode Exit fullscreen mode

The result: a video that tells the story of a change, file by file, in the order that makes sense.

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.mp4
Enter fullscreen mode Exit fullscreen mode

Where 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 engineer joins? Generate videos of the last 10 meaningful PRs. They watch the codebase evolve instead of reading stale wiki pages.

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. Show how the system changed, not just what it looks like now.

Blog posts — Writing about a technique? 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 → MP4
Enter fullscreen mode Exit fullscreen mode
  • 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 image crate, 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 image crate handles pixel-level rendering. git2 (libgit2 bindings) reads the repository directly — no shelling out to git. syntect provides the highlighting. ffmpeg handles 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
Enter fullscreen mode Exit fullscreen mode

Then point it at any repo:

cd your-project
patchcast --diff HEAD~1 -o walkthrough.mp4
Enter fullscreen mode Exit fullscreen mode

Star the repo if this is useful: github.com/LakshmiSravyaVedantham/patchcast


Code reviews shouldn't require a recording studio. They should require one command.

Top comments (0)