gooseworks-ai/goose-skills / skills/video/stitch-videos-ffmpeg
stitch-videos-ffmpeg
VerifiedStitch video segments with ffmpeg concat, xfade, overlay, audio mux, and export settings, and trim a source into named clips at exact windows (trim_clips.py). Ships montage.py, a free montage assembler (python3 + ffmpeg, no keys). It takes a JSON EDL of clips and stills, normalizes them and hard-cuts them in order, burns captions from an SRT, a cue list or word timings, and lays a VO over a music bed that ducks under it, mastered to -14 LUFS.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 13.4 KB |
| scripts/composite.pyexecutable | script | 4.8 KB |
| scripts/composite_final.pyexecutable | script | 3.5 KB |
| scripts/composite_final.shexecutable | script | 295 B |
| scripts/montage.pyexecutable | script | 49.3 KB |
| scripts/normalize_clip.shexecutable | script | 668 B |
| scripts/trim_clips.pyexecutable | script | 7.1 KB |
| scripts/voiceless/composite.py | script | 4.5 KB |
| skill.meta.json | config | 190 B |
| tests/expected-output.md | markdown | 300 B |
| tests/human-test.md | markdown | 853 B |
| tests/sample-input.md | markdown | 568 B |
| tests/smoke-test.md | markdown | 642 B |
| tests/test_stitch_montage.py | script | 18.1 KB |
| tests/test_trim_clips.py | script | 2.2 KB |
tests/test_trim_clips.py
View on GitHub"""scripts/trim_clips.py cuts the windows it is asked for (free: local ffmpeg only, no network).
Run: python3 -m pytest skills/video/stitch-videos-ffmpeg/tests -q
"""
import json
import shutil
import subprocess
import sys
from pathlib import Path
import pytest
SCRIPT = Path(__file__).resolve().parent.parent / "scripts" / "trim_clips.py"
FRAME = 1 / 30
pytestmark = pytest.mark.skipif(not (shutil.which("ffmpeg") and shutil.which("ffprobe")),
reason="ffmpeg/ffprobe not installed")
def duration(path):
out = subprocess.run(["ffprobe", "-v", "error", "-show_entries", "format=duration",
"-of", "default=nw=1:nk=1", str(path)], capture_output=True, text=True, check=True)
return float(out.stdout)
def test_cuts_each_window_and_records_bad_specs(tmp_path):
src = tmp_path / "src.mp4"
subprocess.run(["ffmpeg", "-y", "-hide_banner", "-loglevel", "error",
"-f", "lavfi", "-i", "testsrc=size=160x284:rate=30:duration=4",
"-f", "lavfi", "-i", "sine=frequency=440:duration=4",
"-c:v", "libx264", "-pix_fmt", "yuv420p", "-c:a", "aac", "-shortest", str(src)], check=True)
clips = tmp_path / "clips.json"
clips.write_text(json.dumps([
{"name": "Hook Shot", "start": 0.5, "end": 2.0},
{"name": "middle", "start": "00:02", "duration": 1},
{"name": "backwards", "start": 1, "end": 0.5},
{"name": "tail", "start": 3.5, "duration": 2},
]))
out = tmp_path / "out"
proc = subprocess.run([sys.executable, str(SCRIPT), "--source", str(src), "--clips", str(clips),
"--output-dir", str(out)], capture_output=True, text=True)
assert proc.returncode == 0, proc.stderr
assert abs(duration(out / "hook-shot.mp4") - 1.5) <= 2 * FRAME
assert abs(duration(out / "middle.mp4") - 1.0) <= 2 * FRAME
assert not (out / "backwards.mp4").exists()
manifest = json.loads((out / "manifest.json").read_text())
assert manifest["status"] == "needs human review"
assert any(e.startswith("backwards:") for e in manifest["errors"])
assert any(w.startswith("tail:") and "past the end" in w for w in manifest["warnings"])
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |