Mediamtx docs

From damionrashford/media-os · View interactive version

Mediamtx docs is an AI agent skill from the GitHub repository damionrashford/media-os. Search and fetch official MediaMTX documentation from mediamtx.org: kickoff (introduction, install, upgrade), features (architecture, publish, read, record, playback, authentication, hooks, metrics, forward, proxy, performance, rtsp-specific-features, rtmp-specific-features, webrtc-specific-features

How to use this skill

Skill file

MediaMTX Docs

Context: $ARGUMENTS

Quick start

When to use


Step 1 — Know the page catalog

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

Top-level families:

| Family | When to pick |

|---|---|

| kickoff/* | Install, upgrade, first-run. |

| features/* | Core concepts (publish, read, record, playback, auth, hooks, metrics). |

| features/<proto>-specific-features | Per-protocol options (rtsp-specific-features, rtmp-specific-features, webrtc-specific-features, srt-specific-features). |

| features/configuration + features/control-api + features/logging + features/metrics | Operational — the knobs you actually turn in production. |

| references/configuration-file | Authoritative list of every YAML option. Start here for config questions. |

| references/control-api | Authoritative list of every /v3/* endpoint. |

| publish/<client> | How to SEND a stream in via ffmpeg / gstreamer / OBS / Python / Go / Unity / etc. |

| read/<client> | How to PLAY a stream out via ffmpeg / gstreamer / VLC / OBS / browsers / etc. |

| github-readme, github-mediamtx.yml, github-apidocs | Raw upstream files — the ground truth when mediamtx.org is behind. |

Read CODE0 for the full catalog.


Step 2 — Search first

uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py search --query "recordFormat" --limit 5
uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py search --query "jwt" --page features/authentication
uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py search --query "/v3/paths" --page references/control-api

Use --regex for anchored patterns. Each hit prints page:line, nearest heading, canonical URL, and ±3 lines of context.


Step 3 — Read one section

When a hit surfaces [§anchor]:

uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py section --page features/authentication --id internal-users
uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py section --page references/configuration-file --id paths

--id also accepts a heading keyword as fallback.


Step 4 — Fetch a whole page

Use sparingly — howto pages are compact enough to fetch whole when you actually need the full recipe:

uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py fetch --page publish/ffmpeg
uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py fetch --page read/web-browsers
uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py fetch --page github-mediamtx.yml   # raw upstream YAML

--format json for structured handoff.


Step 5 — Prime cache

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

Fetches every known page (~70 URLs) at 0.3s each. Override cache dir via MEDIAMTX_DOCS_CACHE. Clear with clear-cache.


Gotchas


Examples

Example 1 — "What do I put in mediamtx.yml to enable JWT auth?"

uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py search --query "jwt" --page features/authentication --limit 5
uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py section --page features/authentication --id jwt

Example 2 — "How do I publish with ffmpeg?"

uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py fetch --page publish/ffmpeg

Example 3 — "What's the full list of control-api endpoints?"

uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py fetch --page references/control-api

Example 4 — "What does `runOnDemandCloseAfter` default to?"

uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py search --query "runOnDemandCloseAfter" --page github-mediamtx.yml --limit 3

(Upstream YAML has inline defaults — faster than the HTML docs here.)

Example 5 — "Record to disk, rotate every 15 min, keep 4 hours"

uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py search --query "recordSegmentDuration" --page features/record
uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py search --query "recordDeleteAfter" --page features/record

Example 6 — "WebRTC publish from a browser — what's the WHIP URL?"

uv run ${CLAUDE_SKILL_DIR}/scripts/mtxdocs.py fetch --page publish/web-browsers

Troubleshooting

Error: `unknown page: foo`

Cause: The name isn't in the catalog.

Solution: Run list-pages. Common mistakes: using record instead of features/record; api instead of references/control-api.

Error: `urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]`

Cause: System certificate store is out of date (usually macOS Python).

Solution: Run /Applications/Python\ 3.x/Install\ Certificates.command or set SSL_CERT_FILE. Don't patch SSL verification off.

Search returns zero hits for a config key

Cause: Key might be new in main but not yet in the published docs.

Solution: Search against the upstream YAML — search --query "<key>" --page github-mediamtx.yml. The upstream file is the source of truth.

Results look like broken-up tables

Cause: The HTML extractor flattens cell borders into pipes but can't reconstruct multi-line cells.

Solution: The search-hit header prints the canonical URL. Open it directly in a browser for the authoritative view.

Cache stale after MediaMTX release

Solution: clear-cache then index. The GitHub fallback pages already track main — if you want a specific release tag, edit the github-* URLs in the script's PAGES dict (or fetch directly with urllib).


Reference docs

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.