Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from bundle
Build or revise a reusable FFmpeg timeline for short-form video editing. Use when the user wants an agent-editable API for trimming clips, cropping, fitting to
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: video-timeline-editor3description: Build or revise a reusable FFmpeg timeline for short-form video editing. Use when the user wants an agent-editable API for trimming clips, cropping, fitting to frame, changing speed, adding simple text overlays, and assembling a deterministic final video from existing media.4---56# Video Timeline Editor78Use this skill when a project needs a clean editing layer between raw clips and a final render.910The goal is not to mimic Premiere's UI. The goal is a small, agent-friendly timeline DSL that can be edited safely in code.1112## What This Skill Gives You1314- a reusable FFmpeg timeline engine at `scripts/video_timeline.py`15- a declarative timeline format that agents can rewrite without touching engine internals16- deterministic edits for:17- source in/out cuts18- trim from left/right edges19- clip-bound transcript tracks with real word timestamps20- word-aware trimming when transcript data exists21- speed changes22- normalized crop boxes23- `cover` or `contain` framing for vertical/horizontal outputs24- simple text overlays25- karaoke-style burned captions generated from clip transcripts26- stable concat rendering2728## Workflow29301. Create a dedicated working folder for the video project anywhere you keep project media.312. Put the source clips, transcript JSON files, and final outputs inside that project folder.323. Create the timeline file inside that same project folder.334. Use `references/timeline-template.py` as a starting point, then adapt the structure to the project.345. Run a dry pass first:3536```bash37python3 skills/video-timeline-editor/scripts/video_timeline.py \38--timeline /path/to/timeline.py \39--dry40```41426. Render when timings look right:4344```bash45python3 skills/video-timeline-editor/scripts/video_timeline.py \46--timeline /path/to/timeline.py47```4849If you prefer `uv`, run the packaged command from the skill folder:5051```bash52uv run --project /path/to/video-timeline-editor video-timeline \53--timeline /path/to/timeline.py \54--dry55```5657If you prefer `uvx`, run it directly from the skill folder:5859```bash60uvx --from /path/to/video-timeline-editor video-timeline \61--timeline /path/to/timeline.py62```6364## Suggested Project Layout6566Create one folder per video project. The exact folder name is up to the agent or user.6768Example:6970```text71my-video-project/72├── timeline.py73├── clips/74│ ├── hook.mp475│ └── response.mp476├── transcripts/77│ ├── hook.elevenlabs.transcript.json78│ └── response.elevenlabs.transcript.json79└── final/80├── timeline-render/81└── edit.mp482```8384Use that as a working pattern, not a strict rule. The important part is:8586- timeline file lives in the project folder87- source media lives in the project folder88- transcript JSON files live in the project folder89- outputs and temporary renders live in the project folder9091## Timeline Authoring Rules9293- Keep the engine in the skill. Put project-specific edits in the project's own timeline file.94- Prefer `take=(start, end)` plus `trim=(left, right)` instead of hand-editing FFmpeg args.95- Attach transcript JSON directly on the clip with `captions(...)`.96- Use `trim="word"` when the cut should snap to the nearest full spoken words.97- Use `trim="free"` when picture timing matters more than word boundaries; caption timings will still be recalculated against the final clip.98- Use `cover(anchor="center")` for shorts when the source aspect ratio does not match the target frame.99- Use `crop_box(x, y, width, height)` before fit when you need a specific region of the source.100- Put reusable hacks such as anti-content-ID transforms into named presets with `transform(...)`.101- Keep STT generation separate from this engine. This skill assumes transcript JSON already exists and turns it into clip-local captions.102103## Requirements104105- `ffmpeg`106- `ffprobe`107- `python3`108109## Files110111- `scripts/video_timeline.py`: reusable engine + CLI112- `pyproject.toml`: package entrypoint for `uv run` and `uvx`113- `references/timeline-template.py`: minimal project template114