A command-line tool for detecting static scenes in videos. Analyzes video content frame-by-frame to automatically identify static segments and generates FCPXML marker files for Final Cut Pro X.
- 🎬 Auto-detect static scenes: Frame-by-frame analysis using frame difference method
- 📊 Smart threshold suggestion: Auto-calculate suggested threshold based on P95 percentile
- 💾 Analysis data caching: Generate
.pb.zstfile after first analysis, reuse without re-analysis - 🎯 FCPXML export: Generate Final Cut Pro X compatible marker files
- ⚡ High-performance processing: Concurrent processing and object pool optimization
- 🎨 Subtitle area exclusion: Auto-crop bottom area to avoid hardcoded subtitle interference
- 🗜️ Efficient compression: Protocol Buffers + Zstd compression for smaller data files
- Go 1.25.2+
- OpenCV (via gocv.io/x/gocv)
- Protocol Buffers compiler (protoc)
git clone <repository-url>
cd vcmp
go mod download
make buildmake install # Requires sudo-
First-time video analysis: Place video in current directory, run
vcmpvcmp
-
View analysis statistics: Run
vcmpto view existing.pb.zstresultsvcmp
-
Generate FCPXML markers: Specify threshold
vcmp <threshold> vcmp <threshold> <min_duration>
threshold: Difference pixel threshold. Frames below this are considered staticmin_duration: Minimum duration in seconds (default: 20)
vcmp # Analyze video and generate .pb.zst
vcmp 1000 # Generate FCPXML with suggested threshold
vcmp 800 15 # Custom threshold and min duration
vcmp 1000 30 # Only mark segments longer than 30 seconds- Frame difference: Compare grayscale difference between adjacent frames
- Binarization: Use threshold (default 25) to binarize difference map
- Morphological processing: Use erosion to remove noise
- Segment identification: Consecutive frames below threshold are static segments
Uses P95 (95th percentile) × 1.5 as default suggested threshold:
- Filters most normal frame jitter
- Preserves true static scenes
- Auto-adjusts based on video content
Auto-crops bottom 65/1080 of frame (~6%) to exclude:
- Hardcoded subtitles
- Watermarks
- Other fixed-position UI elements
Analysis data file using Protocol Buffers + Zstd compression, containing:
- Video metadata (resolution, frame rate, total frames)
- Per-frame difference pixel counts
- Suggested threshold
Final Cut Pro X marker file containing:
- Start markers (start1, start2, ...)
- Stop markers (stop1, stop2, ...)
- Video format information
Import method:
- Open Final Cut Pro X
- File → Import → XML...
- Select generated
.fcpxmlfile
make proto # Generate protobuf code
make build # Build binary (auto-generates protobuf)
make install # Build and install to system path
make uninstall # Uninstall from system path
make clean # Clean build files
make run # Build and run
make help # Show helpGPL-3.0