Inspect Media File Codecs with mediainfo
Print every technical detail of a video or audio file — codecs, bitrates, frame rate, track layout — as structured text you can grep.
Run mediainfo video.mkv to list all streams and their parameters, or mediainfo --Output="Video;%Duration%" video.mkv to extract a single value for scripts.
01Command
Command
$ mediainfo video.mkv02What it does
mediainfo parses the container and every stream inside it, reporting codec, profile, bitrate, dimensions, frame rate, and audio channel layout section by section. Unlike ffprobe, its output is a clean human-readable table that's still scriptable via the --Output template syntax (%Width%, %Duration%, and friends). It's the quickest way to answer 'why won't this file play' — a missing codec or an odd sample rate is visible immediately.
03Risk
!Warning: Values like bitrate shown in the header can be container-declared rather than actually measured; use mediainfo --Full for deeper detail when the numbers look suspicious.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- mediainfo(1) — Linux man pageEvidence: mediainfo man page: 'Display technical and tag data for video/audio files' including --Output templates for scripting.
Last verified: 2026-09-17 · Category: Media