Ffmpeg docs

From damionrashford/media-os · View interactive version

Ffmpeg docs is an AI agent skill from the GitHub repository damionrashford/media-os. Search and fetch official FFmpeg documentation from ffmpeg.org: ffmpeg, ffmpeg-all, ffmpeg-filters, ffmpeg-codecs, ffmpeg-formats, ffmpeg-protocols, ffmpeg-devices, ffmpeg-bitstream-filters, ffmpeg-utils, ffmpeg-scaler, ffmpeg-resampler, ffprobe-all, ffplay-all, general, faq, platform, developer. Us

How to use this skill

Skill file

FFmpeg Docs

Context: $ARGUMENTS

Quick start

When to use


Step 1 — Know the page catalog

The script only works against a fixed list of known ffmpeg.org doc pages. Get the list:

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py list-pages

Common picks:

| Question | Page |

|---|---|

| "What does filter X do?" | ffmpeg-filters |

| "What are the options for -c:v libx264?" | ffmpeg-codecs |

| "What HLS muxer options exist?" | ffmpeg-formats |

| "What does srt:// accept?" | ffmpeg-protocols |

| "How do I capture with avfoundation?" | ffmpeg-devices |

| "What bitstream filters are there?" | ffmpeg-bitstream-filters |

| "ffprobe output fields?" | ffprobe-all |

| "Expression syntax (eval, if, gt)?" | ffmpeg-utils |

| "Scaler flags?" | ffmpeg-scaler |

| "Resampler options?" | ffmpeg-resampler |

Read CODE0 for the full catalog with descriptions.


Step 2 — Search first (this is the default)

When the user names a filter, option, muxer, or codec, search across all pages:

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py search --query "tonemap" --limit 5

When you already know which page, scope the search to it (faster, less noise):

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py search --query "hls_time" --page ffmpeg-formats

Output format for each hit:

--- <page>:<line> — <nearest heading>
<canonical URL with anchor>
<snippet with ±3 lines of context>

Use --format json for machine-parseable output when chaining into another tool.

First run downloads the page (~1–2s). Subsequent runs hit the local cache (~/.cache/ffmpeg-docs/) — instant.


Step 3 — Read one section in full

When the search hit points to a specific filter/option and you want the whole block (option list + description), use section:

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py section --page ffmpeg-filters --id tonemap-1

--id accepts either:

Output is the section from its heading down to the next same-or-higher-level heading.


Step 4 — Fetch a whole page

Only when you need to dump the entire page (rare — usually overkill):

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py fetch --page ffmpeg-filters

Pair with --format json for structured handoff.


Step 5 — Prime the cache (optional)

For reliable offline lookups or before a burst of queries:

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py index

Fetches every known page, stores text-extracted versions in ~/.cache/ffmpeg-docs/. Run once; re-run only when you need fresh docs (new ffmpeg release, upstream doc edits).

To override the cache location: export FFMPEG_DOCS_CACHE=/path/to/dir.

To clear: uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py clear-cache.


Gotchas


Examples

Example 1 — "What are the options for the tonemap filter?"

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py search --query "tonemap" --page ffmpeg-filters --limit 5

Pick the hit with heading ## [§tonemap-1] …, then:

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py section --page ffmpeg-filters --id tonemap-1

Cite the URL printed in the hit header when responding.

Example 2 — "What are the valid `hls_segment_type` values?"

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py search --query "hls_segment_type" --page ffmpeg-formats

Example 3 — "What does `-movflags +faststart` actually do?"

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py search --query "faststart" --page ffmpeg-formats

Example 4 — "Does the `sr` filter still exist or is it deprecated?"

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py search --query "sr" --page ffmpeg-filters --regex --limit 3

Use --regex with anchored patterns (^sr\b) when a short term has many false positives.

Example 5 — "What color expressions does `drawtext` accept?"

uv run ${CLAUDE_SKILL_DIR}/scripts/ffdocs.py section --page ffmpeg-utils --id Color

Troubleshooting

Error: `unknown page: foo`

Cause: The name isn't in the catalog.

Solution: Run list-pages to see valid names. Common mistakes: using filters instead of ffmpeg-filters; using protocols instead of ffmpeg-protocols.

Error: `urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]`

Cause: System certificate store is out of date (mostly macOS with older Python installs).

Solution: Install/update certifi, or run /Applications/Python\ 3.x/Install\ Certificates.command. As a last resort, set SSL_CERT_FILE env var to a valid CA bundle path. Do NOT patch the script to disable SSL verification.

Search returns zero hits

Cause: Term doesn't exist on that page, or you're searching a page the term isn't documented on.

Solution: Drop --page to search all pages, or try a broader query. Some options live in ffmpeg-utils (expressions, colors) rather than the obvious page.

Results look truncated / tables broken

Cause: Text extraction flattens complex HTML tables.

Solution: The search-hit header prints the canonical URL with anchor. Open it directly (WebFetch or browser) for the authoritative view.

Cache is stale after ffmpeg upstream update

Solution: clear-cache then index (or just fetch --no-cache --page <name> for a single page).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.