notque/vexjoy-agent / skills/content/video-editing
video-editing
VerifiedVideo editing pipeline: cut footage, assemble clips via FFmpeg and Remotion.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.1 KB |
| references/ffmpeg-commands.md | markdown | 8.1 KB |
| references/ffmpeg-filters.md | markdown | 4.9 KB |
| references/image-to-video.md | markdown | 6.0 KB |
| references/phase-commands.md | markdown | 6.3 KB |
| references/remotion-scaffold.md | markdown | 9.2 KB |
| scripts/image_to_video.pyexecutable | script | 17.2 KB |
| scripts/tests/test_video_editing_scripts.py | script | 2.1 KB |
| scripts/vtt_to_paragraph.py | script | 3.9 KB |
| workspace/.gitignore | other | 202 B |
| workspace/README.md | markdown | 1.4 KB |
| workspace/completed/.gitkeep | other | 0 B |
| workspace/output/.gitkeep | other | 0 B |
scripts/vtt_to_paragraph.py
View on GitHub#!/usr/bin/env python3
"""Clean a WebVTT subtitle file into readable paragraph text.
Handles both uploader subtitles and YouTube auto-captions (rolling
duplicate lines, inline <c>/timing tags, [Music]-style cues).
Stdlib only.
"""
import argparse
import re
import sys
from pathlib import Path
TIMESTAMP_LINE = re.compile(r"^(\d{2}:)?\d{2}:\d{2}\.\d{3}\s+-->\s+(\d{2}:)?\d{2}:\d{2}\.\d{3}")
INLINE_TAG = re.compile(r"<[^>]+>")
BRACKET_CUE = re.compile(r"\[[^\]]*\]|\([^)]*\)")
HEADER_PREFIXES = ("WEBVTT", "Kind:", "Language:", "NOTE", "STYLE", "REGION")
PARAGRAPH_GAP_SECONDS = 4.0
SENTENCES_PER_PARAGRAPH = 5
def parse_start_seconds(line: str) -> float:
"""Return the cue start time in seconds."""
start = line.split("-->")[0].strip()
parts = start.split(":")
seconds = 0.0
for part in parts:
seconds = seconds * 60 + float(part)
return seconds
def extract_cues(text: str, keep_brackets: bool) -> list[tuple[float, str]]:
"""Return (start_seconds, text) cues, deduplicated and tag-free."""
cues: list[tuple[float, str]] = []
current_start = 0.0
seen_tail: str = ""
for raw in text.splitlines():
line = raw.strip()
if not line or line.isdigit() or line.startswith(HEADER_PREFIXES):
continue
if TIMESTAMP_LINE.match(line):
current_start = parse_start_seconds(line)
continue
line = INLINE_TAG.sub("", line)
if not keep_brackets:
line = BRACKET_CUE.sub("", line)
line = re.sub(r"\s+", " ", line).strip()
# Auto-captions roll: each cue repeats the previous line, then adds one.
if not line or line == seen_tail:
continue
seen_tail = line
cues.append((current_start, line))
return cues
def format_timestamp(seconds: float) -> str:
minutes, secs = divmod(int(seconds), 60)
hours, minutes = divmod(minutes, 60)
if hours:
return f"[{hours}:{minutes:02d}:{secs:02d}]"
return f"[{minutes}:{secs:02d}]"
def build_paragraphs(cues: list[tuple[float, str]], timestamps: bool) -> str:
"""Join cues into paragraphs, breaking on silence gaps or sentence count."""
paragraphs: list[str] = []
chunk: list[str] = []
sentence_count = 0
previous_start = None
for start, line in cues:
gap = previous_start is not None and start - previous_start > PARAGRAPH_GAP_SECONDS
if chunk and (gap or sentence_count >= SENTENCES_PER_PARAGRAPH):
paragraphs.append(" ".join(chunk))
chunk = []
sentence_count = 0
if timestamps and not chunk:
chunk.append(format_timestamp(start))
chunk.append(line)
sentence_count += len(re.findall(r"[.!?](?:\s|$)", line))
previous_start = start
if chunk:
paragraphs.append(" ".join(chunk))
return "\n\n".join(paragraphs) + "\n"
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("vtt_file", type=Path, help="input .vtt file")
parser.add_argument("-o", "--output", type=Path, help="write result to file")
parser.add_argument("--timestamps", action="store_true", help="prefix paragraphs with [mm:ss]")
parser.add_argument("--keep-brackets", action="store_true", help="keep [Music]-style cues")
args = parser.parse_args()
try:
text = args.vtt_file.read_text(encoding="utf-8", errors="replace")
except OSError as exc:
print(f"error: {exc}", file=sys.stderr)
return 1
cues = extract_cues(text, keep_brackets=args.keep_brackets)
if not cues:
print("error: no subtitle text found in file", file=sys.stderr)
return 1
result = build_paragraphs(cues, timestamps=args.timestamps)
if args.output:
args.output.write_text(result, encoding="utf-8")
else:
sys.stdout.write(result)
return 0
if __name__ == "__main__":
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |