clip-editing
Skill4 starsChanged 3 months agoMITView on GitHub
TRIGGER: user records screen-capture clips (MP4) and wants them trimmed, cut, merged, or annotated, or asks to review/verify a video clip. Uses the installed ffmpeg 8.1.1 (winget full build) to edit clips directly; extracts frames so the agent can visually verify results before delivery.
In this repository5 other files it gives its agents.
- app-debug-workflowSkill
- complex-project-workflowSkill
- media-clipperSkill
- web_extractSkill
- web_searchSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
All scripts are Python 3 (stdlib only — subprocess + json), run from anywhere
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Clip Editing — ffmpeg-based video editing for screen-capture clips
When to Use
- User records short screen-capture demo clips (e.g. product marketing clips) and wants:
- junk removed from start/end (fumbling with files, cmd windows visible)
- a middle segment cut out
- two takes merged into one clip
- a text overlay added (e.g. "E:\ → F:")
- visual verification of a clip before publishing
- Trigger phrases: "trim the clip", "cut out the middle", "merge the takes", "add text to the clip", "check the clip", "edit the clip"
Environment
- ffmpeg 8.1.1 (winget full build) — verified working on Windows Server 2025 via
gdigrab - ffprobe sits next to ffmpeg in the same bin directory
- Path resolution order:
FFMPEG_PATH/FFPROBE_PATHenv vars → winget Packages path (derived from%LOCALAPPDATA%) →ffmpeg/ffprobeon PATH - All scripts are Python 3 (stdlib only — subprocess + json), run from anywhere
Quick Reference (scripts in scripts/)
| Script | Purpose | Example |
probe.py | Get duration / resolution / fps / size | python scripts/probe.py in.mp4 |
frames.py | Extract frames for agent vision review | python scripts/frames.py in.mp4 outdir --fps 1 |
trim.py | Remove junk from start/end (accurate re-encode by default, --fast = stream copy) | python scripts/trim.py in.mp4 out.mp4 --start 3 --duration 10 |
cut.py | Remove a middle segment | python scripts/cut.py in.mp4 out.mp4 --remove 3-5 |
merge.py | Merge multiple clips in order | python scripts/merge.py out.mp4 a.mp4 b.mp4 |
concat.py | Lossless stream-copy concat via list file (fast join of same-codec clips; auto-falls back to re-encode on mismatch) | python scripts/concat.py out.mp4 list.txt |
overlay_text.py | Add text overlay (bottom/top/center) | python scripts/overlay_text.py in.mp4 out.mp4 --text "E:\ -> F:\" --pos bottom |
speed.py | Speed up/down a clip (shortens/lengthens) | python scripts/speed.py in.mp4 out.mp4 --factor 1.25 |
Procedure
- Probe first —
probe.pygives duration/fps so you know how much junk to trim and the exact timestamps to cut. - Extract frames —
frames.pyat 1-2fps so the agent can SEE the clip (via vision) and pick precise trim/cut points. Review the frames before deciding. - Edit — trim / cut / merge / overlay as needed.
- Verify the OUTPUT — extract frames from the edited clip and visually confirm: clean start frame, correct content, no fumbling visible. Never deliver an unverified clip.
- Report — state the before/after duration and what was changed.
Pitfalls
-c copytrims snap to keyframes — screen captures have sparse keyframes, so stream-copy trims can be off by seconds.trim.pyre-encodes by default for accuracy;--fastis only for quick drafts.- drawtext escaping — fontfile colons must be escaped (
C\:/Windows/Fonts/segoeui.ttf), and the path must use forward slashes (backslashes get mangled by drawtext's escape parser). Text colons/percent/backslashes must be escaped in order: backslash → colon → percent → quote.overlay_text.pyhandles all of this internally — verified pixel-identical to atextfile=reference render (diff YAVG=0). - Fonts on Server 2025 — arial.ttf may not exist; the script falls back to segoeui.ttf (always present on Windows).
- Merge needs matching codecs — clips from the same recorder are fine.
merge.pyre-encodes via the concat filter so minor mismatches still work. concat.pyvsmerge.py— useconcat.pywhen joining same-codec clips (stream copy, lossless, near-instant) via a concat list file; it auto-probes and falls back to re-encode if any clip differs in codec/resolution/pix_fmt/fps/timebase.concat.pyis the right tool for joining multiple takes of marketing clips shot with identical settings;merge.pyis the simpler video-only re-encode for arbitrary mismatched clips. Both route filenames with apostrophes to the re-encode path automatically.- Windows paths in bash — pass native
C:\...paths; Python handles them. Quote paths containing spaces. - Always verify with
frames.pyafter editing — the agent's vision check is the final gate.
Verification
probe.pyon output shows the expected duration (e.g. 10s after trimming to 10s).frames.pyon output shows a clean first frame (no fumbling, no stray windows) and the correct content.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

