video-processor
Remove specified segments from a video and concatenate the remainder into `compressed_video.mp4`, then generate the task-format `compression_report.json` from the final merged segment list.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- video-processor
- description
- Remove specified segments from a video and concatenate the remainder into `compressed_video.mp4`, then generate the task-format `compression_report.json` from the final merged segment list.
02 资源文件 1
- 脚本scripts/process_video.py5.3 KB
03 SKILL.md 正文
Steps
- Blocking terminal-result gate (must-follow in execution runs):
- Execution state is RED until terminal tool results confirm both required artifacts and every completion check below.
- While state is RED, every assistant response must include an actual
terminaltool call for the next incomplete pipeline action. - A command written in prose, JSON, or a code block is still pending because it has no terminal result.
- Advance a step only after its real tool result returns.
- State becomes GREEN only after tool results confirm:
/root/compressed_video.mp4/root/compression_report.json
- Mandatory end-to-end pipeline (use these skills in order):
- Extract audio (
audio-extractor) to/root/audio.wav. - Calculate energy (
energy-calculator) to/root/energies.json(keep 1s windows unless you also change time mapping everywhere). - Detect opening (
silence-detector) and apply the smoothing-window timestamp alignment to produce/root/silence.json.- Use the adjusted
opening_endas the boundary for pause detection.
- Use the adjusted
- Detect pauses (
pause-detector) starting atopening_endwith precision-oriented settings:- Prefer
--min-duration 3(or4) to avoid removing borderline natural 2s pauses. - Remember: lower
threshold_ratiois more conservative; higher is more aggressive.
- Prefer
- Combine + merge removal segments:
- Use
segment-combinerto create/root/all_segments.json. - Ensure segments follow
[start, end)convention, are merged (union), sorted, non-overlapping, and haveduration == end - start.
- Use
- Process the video using the final merged segments list:
python3 /root/.claude/skills/video-processor/scripts/process_video.py \ --input data/input_video.mp4 \ --output /root/compressed_video.mp4 \ --remove-segments /root/all_segments.json - Generate the required task report from the actual outputs (do not rely on
process_video.py’s internal_report.jsonfor the task schema):python3 /root/.claude/skills/report-generator/scripts/generate_report.py \ --original data/input_video.mp4 \ --compressed /root/compressed_video.mp4 \ --segments /root/all_segments.json \ --output /root/compression_report.json - Verify outputs and iterate if needed (tighten detection to improve precision before re-rendering):
- both files exist and are non-empty
ffprobereads/root/compressed_video.mp4and shows valid video+audio streams- JSON parseable and contains:
original_duration_seconds,compressed_duration_seconds,removed_duration_seconds,compression_percentage,segments_removed segments_removedsorted & non-overlapping; each has numericstart < endandduration == end - start- math consistency:
original ≈ compressed + removed(using measured durations)
- Extract audio (
- Segment hygiene expectations for this processor (to avoid invalid edits):
- Provide removal segments that are already merged (no nesting/overlap) and in
[start, end)seconds. - If you change pause detection parameters, re-run segment merge before processing so the report matches what was actually removed.
- Provide removal segments that are already merged (no nesting/overlap) and in
Expected Result
A processed /root/compressed_video.mp4 with the opening and long non-teaching pauses removed (without excessive false-positive cuts), plus /root/compression_report.json matching the required schema and consistent with the actual video durations and the final merged segments list.
04 同仓库更多 Skills
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms