Media mediainfo

From damionrashford/media-os · View interactive version

Media mediainfo is an AI agent skill from the GitHub repository damionrashford/media-os. Deep container and stream analysis with MediaInfo (mediainfo --Output=JSON --Full --Inform): codec profiles and levels, bitrate ladders, GOP structure, HDR10 + HDR10+ + Dolby Vision metadata, audio stream channel descriptions, container quirks beyond ffprobe. Use when the user asks to get detailed m

How to use this skill

Skill file

Media Mediainfo

Context: $ARGUMENTS

Quick start

When to use

Step 1 — Install

# macOS
brew install mediainfo

# Debian / Ubuntu
sudo apt-get install -y mediainfo

# verify
mediainfo --Version

Same binary and engine power the CLI and the GUI app — the JSON schema is stable across versions, so pin to JSON for automation.

Step 2 — Pick an output format

mediainfo in.mp4                                 # human-readable default
mediainfo --Full in.mp4                          # every tag, verbose (HDR, DV, GOP live here)
mediainfo --Output=JSON in.mp4                   # machine-readable, stable schema
mediainfo --Output=XML  in.mp4                   # XML tree, same info as JSON
mediainfo --Output=HTML in.mp4 > report.html     # browseable report
mediainfo --Output=EBU  in.mxf                   # EBU Core XML for broadcast
mediainfo --Output=PBCore in.mxf                 # PBCore XML for archives
mediainfo --Output=MPEG-7 in.mp4                 # MPEG-7 description
mediainfo --Output=CSV  in.mp4                   # CSV rows

Specific-field templates use --Inform="<stream>;<format>" and %Field% tokens:

mediainfo --Inform="Video;%Width% x %Height% @ %FrameRate%fps"  in.mp4
mediainfo --Inform="General;%Format% %Duration/String3%ms"      in.mp4
mediainfo --Inform="Audio;%Format% %Channels%ch %SamplingRate%" in.mp4

--Output picks a preset. --Inform customizes. %Field% names are MediaInfo's (not ffprobe's) — see references/mediainfo.md for the catalog.

Step 3 — Parse

Use JSON for automation. The root is {"media": {"track": [...]}}; each track has "@type" in {General, Video, Audio, Text, Image, Menu, Other}.

mediainfo --Output=JSON in.mp4 | jq '.media.track[] | {type: ."@type", format: .Format}'
mediainfo --Output=JSON in.mp4 | jq '.media.track[] | select(."@type"=="Video") | {w:.Width, h:.Height, prof:."Format profile", bd:.BitDepth}'
mediainfo --Output=JSON in.mp4 | jq '.media.track[] | select(."@type"=="Audio") | {codec:.Format, ch:.Channels, layout:.ChannelLayout}'

HDR / Dolby Vision inspection:

mediainfo --Full in.mkv | grep -i -E "colour|HDR|mastering|MaxCLL|MaxFALL|Dolby Vision|DV"
mediainfo --Full in.mp4 | grep -i dv                 # DV profile lines

GOP structure + codec profile:

mediainfo --Full in.mp4 | grep -i -E "format profile|gop|bframe|reference frame"

Per-codec profile strings:

Step 4 — Use with diagnostics (this skill's script)

uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py check
uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py summary      --input in.mp4
uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py json         --input in.mp4
uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py field        --input in.mp4 --stream Video --name Width
uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py hdr          --input in.mkv
uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py codec-profile --input in.mp4
uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py compare      --inputs a.mp4 b.mp4
uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py netflix-check --input in.mp4

hdr returns a verdict (SDR / HDR10 / HDR10+ / HLG / DolbyVision) plus details. codec-profile parses profile + level for every video + audio stream. netflix-check flags common Netflix IMF/4K deliverables: HEVC Main 10, 10-bit, BT.2020, PQ, 3840x2160 or higher, ≥ 16 Mb/s for 4K.

Gotchas

Examples

Example 1 — Is this file HDR10 or Dolby Vision?

uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py hdr --input in.mkv
# {"verdict":"DolbyVision","dv_profile":"8.1","transfer":"PQ","primaries":"BT.2020","max_cll":1000,"max_fall":400}

Example 2 — Netflix 4K HDR10 delivery pre-flight

uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py netflix-check --input master.mxf
# {"pass":true,"checks":{"codec":"HEVC","profile":"Main 10","bit_depth":10,"resolution":"3840x2160","hdr":"HDR10","bitrate_mbps":18.4}}

Example 3 — Extract one field for scripting

uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py field --input in.mp4 --stream Video --name "Format profile"
# High@L4.1

Example 4 — Compare two encodes

uv run ${CLAUDE_SKILL_DIR}/scripts/mediainfo.py compare --inputs src.mov encode.mp4

Troubleshooting

Error: `mediainfo: command not found`

Cause: MediaInfo is not installed.

Solution: brew install mediainfo (macOS) or apt-get install mediainfo (Linux). Verify with mediainfo --Version.

Field is missing in the JSON

Cause: Codec metadata (SPS/PPS/VPS) not present in the muxed bitstream, or the field is only surfaced by --Full.

Solution: Re-run with --Full. If still missing, fall back to ffprobe -show_streams -show_frames for bitstream-derived values.

HDR / Dolby Vision not detected

Cause: Streaming segment without the init/header segment; or a partial file truncated before the config record.

Solution: Point MediaInfo at the init segment (init.mp4) or the full file. For DASH/CMAF, run MediaInfo on the init segment concatenated with one media segment.

URL input hangs

Cause: Server does not support HTTP Range requests; MediaInfo tries to stream blindly.

Solution: Download with curl -o file.mp4 URL then run MediaInfo on the local file.

`--Inform` returns nothing

Cause: Wrong stream name (case matters: Video not video) or unknown field name.

Solution: Check references/mediainfo.md for the exact %Field% catalog per stream type.

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.