Agent skill
video-trimmer
Trim and cut videos by timestamp with precision. Supports both stream copy (fast) and re-encoding (quality) modes. Use when you need to extract specific segments from videos, create clips from highlights, or cut unwanted portions.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/video-trimmer
Metadata
Additional technical details for this skill
- version
- 1.0
SKILL.md
Video Trimmer
This skill enables AI agents to trim and cut videos with precision using FFmpeg.
When to Use
- User wants to extract a specific segment from a video
- Creating clips from highlight timestamps
- Removing unwanted portions from videos
- Cutting videos for short-form content
- Trimming based on detected highlights
Available Scripts
scripts/trim.py
Trim video to specified time range.
Usage:
python skills/video-trimmer/scripts/trim.py <video_path> [options]
Options:
--start, -s: Start time (seconds or HH:MM:SS) - required--end, -e: End time (seconds or HH:MM:SS) - required--output, -o: Output video path (default:<video_path>_trimmed.mp4)--reencode: Re-encode video (higher quality, slower)--codec: Video codec for re-encoding (default: libx264)--quality: Quality preset (fast, medium, slow) - default: fast--copy: Use stream copy (faster, no quality loss)
Examples:
Trim 10-second segment:
python skills/video-trimmer/scripts/trim.py video.mp4 --start 30 --end 40
Trim with timestamp format:
python skills/video-trimmer/scripts/trim.py video.mp4 --start 00:01:30 --end 00:01:45
Re-encode for better quality:
python skills/video-trimmer/scripts/trim.py video.mp4 --start 30 --end 40 --reencode --quality medium
Fast stream copy:
python skills/video-trimmer/scripts/trim.py video.mp4 --start 30 --end 40 --copy
scripts/trim_multiple.py
Trim multiple segments from one video.
Usage:
python skills/video-trimmer/scripts/trim_multiple.py <video_path> --segments <json_file> [options]
Options:
--segments: JSON file with segment list--output-dir: Output directory (default:./clips/)--copy: Use stream copy--prefix: Filename prefix for clips
Segments JSON Format:
[
{"start": 30, "end": 45},
{"start": 120, "end": 135},
{"start": 200, "end": 220}
]
Example:
python skills/video-trimmer/scripts/trim_multiple.py video.mp4 --segments segments.json --prefix highlight
Output
Single Trim
Returns trimmed video file:
video_trimmed.mp4
Multiple Trims
Returns multiple clip files:
clips/
highlight_001.mp4
highlight_002.mp4
highlight_003.mp4
Modes Explained
Stream Copy (Default, Fast)
- Speed: Very fast (seconds)
- Quality: No quality loss (exact copy)
- Use when: Quick cuts, same codec segments
- Limitations: Cut points may not be frame-perfect
Re-encode (High Quality)
- Speed: Slower (depends on length)
- Quality: Frame-perfect, configurable quality
- Use when: Frame-accurate cuts, codec conversion
- Options: Adjust CRF for quality vs file size
Time Formats
Supported time formats:
- Seconds:
30,45.5,120 - MM:SS:
1:30,2:45 - HH:MM:SS:
00:01:30,01:15:30
Integration with Other Skills
After trimming, you can use these skills:
portrait-resizer: Convert to 9:16 portrait formatsubtitle-overlay: Add captions to clipsautocut-shorts: Full workflow with all steps
Common Workflow
- User provides video file
- Find highlights using
highlight-scanner - Trim segments using this skill
- Resize to portrait using
portrait-resizer - Add subtitles using
subtitle-overlay
Tips
- Use
--copyfor fast processing when quality isn't critical - Use
--reencodefor frame-perfect cuts - Trimming before resizing is more efficient
- Keep 2-3 second buffers around highlights for context
- Use JSON input for batch trimming
Error Handling
- Invalid timestamps: Returns error with valid range
- Out of bounds: Clamps to video duration
- File not found: Clear error message
- Codec issues: Falls back to re-encoding
Performance
- Stream copy: ~1 second per minute of video
- Re-encode: ~5-30 seconds per minute (depends on quality)
- Batch processing: Processes sequentially
References
- FFmpeg documentation: https://ffmpeg.org/documentation.html
- FFmpeg trim filter: https://ffmpeg.org/ffmpeg-filters.html#trim
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?