Process videos by removing segments and concatenating remaining parts. Use when you need to remove detected pauses/openings from videos, create highlight reels, or batch process segment removals using ffmpeg filter_complex.
Processes videos by removing specified segments and concatenating the remaining parts. Handles multiple removal segments efficiently using ffmpeg's filter_complex.
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
--input: Path to input video file--output: Path to output video file--remove-segments: JSON file containing segments to remove{
"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
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
}
For 3 segments to keep:
[0:v]trim=start=600:end=610,setpts=PTS-STARTPTS[v0];
[0:a]atrim=start=600:end=610,asetpts=PTS-STARTPTS[a0];
[0:v]trim=start=613:end=1000,setpts=PTS-STARTPTS[v1];
[0:a]atrim=start=613:end=1000,asetpts=PTS-STARTPTS[a1];
[v0][v1]concat=n=2:v=1:a=0[outv];
[a0][a1]concat=n=2:v=0:a=1[outa]
# Process video with opening and pause removal
python3 /root/.claude/skills/video-processor/scripts/process_video.py \
--input /root/lecture.mp4 \
--output /root/compressed.mp4 \
--remove-segments /root/opening.json /root/pauses.json
# Result: 65 min → 51 min (21.2% compression)
-preset medium for balanced speed/quality-crf 23 for good quality at reasonable size