SKILL.md
Video Segment Processor
Processes videos by removing specified segments and concatenating the remaining parts. Handles multiple removal segments efficiently using ffmpeg's filter_complex.
Use Cases
- Removing detected pauses and openings from videos
- Creating highlight reels by keeping only specific segments
- Batch processing multiple segment removals
Usage
python3 /root/.claude/skills/video-processor/scripts/process_video.py \
--input /path/to/input.mp4 \
--output /path/to/output.mp4 \
--remove-segments /path/to/segments.json
Parameters
--input: Path to input video file--output: Path to output video file--remove-segments: JSON file containing segments to remove
Input Segment Format
{
"segments": [
{"start": 0, "end": 600, "duration": 600},
{"start": 610, "end": 613, "duration": 3}
]
}
Or multiple segment files:
python3 /root/.claude/skills/video-processor/scripts/process_video.py \
--input video.mp4 \
--output output.mp4 \
--remove-segments opening.json pauses.json
Output
Creates the processed video and a report JSON:
{
"original_duration": 3908.61,
"output_duration": 3078.61,
"removed_duration": 830.0,
"compression_percentage": 21.24,
"segments_removed": 91,
"segments_kept": 91
}
How It Works
- Load removal segments from JSON file(s)
- Calculate keep segments (inverse of removal segments)
- Build ffmpeg filter to trim and concatenate
- Process video using hardware-accelerated encoding
- Generate report with statistics
