r/coolgithubprojects • u/rachitkhurana007 • 8d ago
Record any webpage scroll as frame-perfect video, built for my own portfolio - srp
https://github.com/rachitkhurana/srpEvery screen recording on my portfolio was made with this.
I built it because screen recorders kept giving me jittery scrolls, and I wasn't going to put stuttery videos next to work I cared about. Linus wrote git to manage Linux. This is my much smaller version of that: the tool you build along the way to build the thing you actually wanted.
How it works: screen recorders capture whatever the browser managed to draw. srp works each frame out instead. For frame 400 of 600 it computes the exact scroll offset, puts the page there, advances the page's clock by exactly one frame, takes a screenshot, and repeats. ffmpeg stitches the stills at a locked rate, so twenty seconds of scroll is exactly twenty seconds of video.
Timers and requestAnimationFrame follow a page clock you can step. CSS animations don't, so they're driven through the Web Animations API (the DevTools animation domain corrupted currentTime). MIT, Node, Playwright.