An automated video processing tool that detects and extracts kill moments from Counter-Strike 2 gameplay recordings. The application uses computer vision techniques to identify kill feed events and automatically creates clip compilations.
- Automatic Kill Detection: Uses template matching and edge detection to identify kill feed events
- Smart Clip Merging: Combines consecutive kills into single highlight clips
- ROI (Region of Interest): Focus detection on specific screen areas for better performance
- Color Filtering: Distinguishes between player kills (red border) and teammate kills (gray border)
- Multi-language Support: Available in Turkish and English
- Modern GUI: Built with CustomTkinter for a sleek, dark-themed interface
- Real-time Preview: Watch detection in action with live frame preview
- Batch Processing: Process multiple videos automatically
- Smart Caching: Skips already processed videos
- FFmpeg Integration: Fast, lossless clip extraction with audio preservation
- Python 3.8 or higher
- FFmpeg (must be in system PATH)
- Windows OS (currently optimized for Windows)
pip install opencv-python numpy customtkinter pillowOr use the requirements file if provided:
pip install -r requirements.txt- Download FFmpeg from ffmpeg.org
- Extract the archive
- Add the
binfolder to your system PATH - Verify installation:
ffmpeg -version
You need a template image of the CS2 kill feed icon:
- Take a screenshot during a kill
- Crop just the kill feed icon/symbol
- Save as
killfeed_template.jpgin the project root
Optional: For ROI preview, include an example.jpg screenshot showing your typical CS2 UI.
Double-click start.bat or run:
pythonw gui.pyThe application is configured through config.json. All settings can also be adjusted via the GUI Settings tab.
| Setting | Default | Description |
|---|---|---|
LANGUAGE |
"tr" |
Interface language ("tr" or "en") |
INPUT_FOLDER |
"input_videos" |
Folder containing videos to process |
OUTPUT_FOLDER |
"kills" |
Folder where clips will be saved |
TEMPLATE_PATH |
"killfeed_template.jpg" |
Path to kill feed template image |
| Setting | Default | Description |
|---|---|---|
THRESHOLD |
0.55 |
Template matching threshold (0.0-1.0). Higher = more strict |
FRAME_SKIP |
120 |
Process every Nth frame (120 = every 2 seconds at 60fps) |
KILL_COOLDOWN |
2.0 |
Minimum seconds between kill detections |
USE_EDGE_DETECTION |
true |
Use Canny edge detection for better accuracy |
USE_COLOR_FILTER |
true |
Filter by red border (player kills only) |
CANNY_THRESHOLD1 |
150 |
Canny edge detection lower threshold |
CANNY_THRESHOLD2 |
250 |
Canny edge detection upper threshold |
MIN_COLOR_PIXELS |
150 |
Minimum red pixels to confirm player kill |
| Setting | Default | Description |
|---|---|---|
BUFFER_BEFORE |
4.0 |
Seconds to include before kill |
BUFFER_AFTER |
4.0 |
Seconds to include after kill |
MIN_KILL_GAP |
7.0 |
Merge kills within this time gap (seconds) |
| Setting | Default | Description |
|---|---|---|
USE_ROI |
true |
Only scan specific screen region |
ROI_X_START |
0.83 |
ROI left edge (0.0-1.0, percentage of width) |
ROI_Y_START |
0.07 |
ROI top edge (0.0-1.0, percentage of height) |
ROI_X_END |
1.0 |
ROI right edge (0.0-1.0, percentage of width) |
ROI_Y_END |
0.25 |
ROI bottom edge (0.0-1.0, percentage of height) |
| Setting | Default | Description |
|---|---|---|
KILL_COLOR_LOWER |
[0, 120, 80] |
HSV lower bound for red (range 1) |
KILL_COLOR_UPPER |
[10, 255, 255] |
HSV upper bound for red (range 1) |
KILL_COLOR_LOWER2 |
[170, 120, 80] |
HSV lower bound for red (range 2) |
KILL_COLOR_UPPER2 |
[180, 255, 255] |
HSV upper bound for red (range 2) |
- Place your CS2 gameplay recordings in the
input_videosfolder - Supported formats:
.mp4,.avi,.mov,.mkv,.flv,.wmv
Run start.bat or execute pythonw gui.py
- Click "โถ Start Processing" to begin
- Monitor real-time logs showing detection progress
- View live preview of detected kills
- Track progress bar and statistics
- View all videos in the input folder
- See processing status (โ Processed / โณ Waiting)
- File size information
- Quick access to input folder
- Browse all extracted clips
- See file details and source video
- Play clips directly from the interface
- Quick access to output folder
- Adjust all detection parameters
- Configure ROI with live preview overlay
- Change buffer times
- Modify detection thresholds
- Save settings with one click
The application follows this workflow:
- Scan Input: Discovers all video files in
input_videos - Skip Processed: Checks
processed_videos.jsonto avoid reprocessing - Detect Kills: Uses template matching to find kill feed events
- Filter Results: Applies edge detection and color filtering
- Merge Clips: Combines consecutive kills into single segments
- Extract Clips: Uses FFmpeg to create video clips with buffers
- Save Results: Outputs clips to
killsfolder with descriptive names
Clips are named descriptively:
{original_video_name}_kill_{number}_{start_time}s-{end_time}s.mp4
Example:
competitive_match_kill_001_45.3s-52.1s.mp4
- Template Quality: Use a clear, high-contrast screenshot of the kill feed icon
- ROI Configuration: Use the ROI preview to ensure the kill feed area is covered
- Threshold Tuning:
- Too low (< 0.50): False positives
- Too high (> 0.70): Missed kills
- Start at 0.55 and adjust
- Frame Skip: Higher values = faster processing but may miss quick kills
- Color Filter: Disable if you want teammate kills included
- Buffer Times: Adjust for desired clip length (default: 8 seconds total)
- AI-Powered Kill Detection: Machine learning models for more accurate and intelligent kill detection
- Multi-game Support: Expand to other FPS games (Valorant, Apex Legends, Call of Duty, Overwatch, etc.)
- More Detection Methods: Improved algorithms for better accuracy
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
For issues, questions, or suggestions, please open an issue on the repository.
Made with โค๏ธ for the CS2 community