mediainfo
Display media file information
TLDR
Display metadata for a given file in the console
Store the output to a given file along with displaying in the console
List metadata attributes that can be extracted
SYNOPSIS
mediainfo [OPTION...] <file|directory|URL...>
Examples:
mediainfo my_video.mp4
mediainfo --Output=XML ~/videos/
mediainfo --Inform=file://my_template.txt stream.mkv
PARAMETERS
-h, --help
Displays the help message, showing available options and their usage.
--version
Outputs the current version of the mediainfo application.
-f, --full
Provides a more detailed and comprehensive set of information for the media file.
--Output=format
Specifies the output format. Common values include Text (default), XML, JSON, HTML, CSV, and more. This is crucial for scripting.
--Inform=template
Allows for highly customized output using a specific template string or by loading a template from a file (e.g., file://template.txt). This enables extraction of very specific data fields.
--Language=xx|en
Sets the language for the displayed information (e.g., en for English, fr for French).
--LogFile=file
Directs the output of mediainfo to a specified log file instead of standard output.
-v, --Verbose
Increases the verbosity of the output, often used for debugging or more in-depth analysis.
<file|directory|URL...>
Specifies the path to one or more media files, directories containing media files, or direct URLs to media streams that mediainfo should analyze.
DESCRIPTION
mediainfo is a powerful command-line utility used to analyze and display detailed technical and tag information about audio, video, and various multimedia container files. It supports a vast array of formats, including but not limited to MPEG-4, QuickTime, Matroska, AVI, WMV, MP3, WAV, and more.
The tool provides comprehensive data such as codec details, bitrates, resolutions, aspect ratios, frame rates, audio channels, sampling rates, duration, subtitle tracks, chapter information, and embedded metadata. It is an indispensable tool for multimedia professionals, developers, and enthusiasts involved in video production, quality control, media archiving, and general content analysis.
Beyond its default human-readable text output, mediainfo can present information in various structured formats like XML, JSON, HTML, and CSV, making it suitable for scripting and integration into automated workflows. Its cross-platform nature ensures widespread usability across different operating systems.
CAVEATS
While powerful, mediainfo's accuracy is dependent on the quality and completeness of the metadata embedded within the media file. Corrupted or malformed files may result in incomplete or incorrect information. For very large files or processing a large batch, it can be resource-intensive. The command-line interface, while robust, may not be as intuitive for beginners as its graphical user interface counterpart.
<B>CUSTOM OUTPUT FLEXIBILITY</B>
The --Inform option is one of mediainfo's most powerful features. It allows users to define exactly what information they want to extract and in what format, enabling highly specific data parsing for automated scripts and custom reports. This includes access to hundreds of different fields per stream type (General, Video, Audio, Text, etc.).
<B>CROSS-PLATFORM AVAILABILITY</B>
Beyond Linux, mediainfo is available for Windows, macOS, and various other operating systems, ensuring consistent media analysis capabilities across different environments.
HISTORY
mediainfo was originally created by Jérôme Fenal and first released around 2002. It is part of the MediaArea.net open-source project, which also includes other tools for media analysis and validation. Over the years, it has gained widespread adoption in various sectors, from professional broadcast and post-production to home media management, due to its comprehensive format support and consistent updates to handle new codecs and container specifications.