Aleksei Makeev.
← ALL WORK
06 / 07VIDEO AUTOMATIONPYTHON · FASTAPI · FFMPEG2026

CS2 Highlights — an editor that never opens an editor

Sign in with FACEIT, pick a few matches, get a cut highlight reel. The pipeline reads the demo files, works out which moments are worth keeping, drives the game itself to record them, and renders the video.

Python 3.11FastAPISQLAlchemydemoparser2FFmpegOAuth2 + PKCEServer-sent events
A running render job with detected moments and live progress
PROBLEM

The clips a player wants are buried inside demo files: a 1v4 is a few hundred ticks somewhere in a forty-minute match, and the only way to find it is to watch the match again. Cutting it afterwards costs more time than the clip is worth, which is why most players never make a reel at all. A better video editor doesn’t help here — the boring part has to disappear, not get faster.

APPROACH

A Rust-backed parser reads the demos for kill and defuse events, plus how many players are still alive at each tick. The moments are then scored by fixed rules: multi-kills from one to ten points, clutches from two to fifteen, with bonuses for defusing in a clutch or taking the opening kill. Whatever wins gets recorded by the game itself — a generated autoexec seeks to the tick and writes out a frame sequence. FFmpeg turns those into a clip with kill flashes, a slow-motion tail, a zoom on the clutches, badges, transitions and music, and the browser watches it happen over server-sent events.

DEMO FILE TO FINISHED REEL, UNATTENDED
1 · Sign in

FACEIT OAuth2 with PKCE, then the player's match history.

2 · Parse

demoparser2 reads kill and defuse events plus alive counts at every tick.

3 · Score

Multi-kills 1–10 points, clutches 2–15, bonuses for a clutch defuse or an opening kill.

4 · Capture

A generated autoexec seeks to the tick; startmovie writes a frame sequence out of the game.

5 · Render

FFmpeg assembles the clips and the browser follows along over server-sent events.

curves=kill flash setpts=slow-mo tail zoompan=clutch zoom drawtext=2K / 3K / ACE badge xfade=wiperight amix=music bed

PKCE
OAUTH2 IMPLEMENTED BY HAND
2–15
POINT BANDS FOR MULTI-KILLS AND CLUTCHES
6
STAGE FFMPEG EDIT PIPELINE