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.
Installation
Details
Usage
After installing, this skill will be available to your AI coding assistant.
Verify installation:
npx agent-skills-cli listSkill Instructions
name: video-processor description: 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.
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
FFmpeg Filter Example
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]
Dependencies
- ffmpeg with libx264 and aac support
- Python 3.11+
Limitations
- Processing time: ~0.3× video duration (e.g., 20 min for 65 min video)
- Requires sufficient disk space (output ≈ 70-80% of input size)
- May have frame-accurate cuts (not sample-accurate)
Example
# 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)
Performance Tips
- Use
-preset mediumfor balanced speed/quality - Use
-crf 23for good quality at reasonable size - Process on machines with 2+ CPU cores for faster encoding
Notes
- Preserves video quality using CRF encoding
- Maintains audio sync throughout
- Handles edge cases (segments at start/end of video)
- Generates detailed statistics for verification
More by benchflow-ai
View allManage SSL/TLS certificates and diagnose certificate issues. Use when the user says "cert expiring", "SSL error", "certificate problem", "renew certificate", "check certificate", "HTTPS not working", or asks about TLS/SSL.
This skill provides guidance for generating self-signed SSL/TLS certificates using OpenSSL. Use this skill when tasks involve creating private keys, self-signed certificates, certificate signing requests (CSRs), or combined PEM files. It covers verification strategies and common pitfalls in certificate generation workflows.
This skill should be used when the user asks about "package development workflow", "release process", "beta testing", "package versioning", "CumulusCI", "CI/CD for packages", or needs guidance on the end-to-end package development process from design through release.
Generates nginx.default.conf for nginx conf.d directory configuration. Serves static files from /usr/share/nginx/html.
