Extract Video Metadata in INI Format with FFmpeg

Extracting video metadata into a structured, easily readable format is a common task in media processing and automation. This article provides a straightforward guide on how to use ffprobe, the stream analyzer included with the FFmpeg suite, to extract comprehensive video metadata and output it directly in the INI configuration format. You will learn the exact command-line syntax to retrieve this data and how to save it to a file.

To extract metadata in INI format, you must use the ffprobe command-line tool. While ffmpeg is used for transcribing and editing, ffprobe is specifically designed for gathering media information.

Run the following command in your terminal:

ffprobe -v error -show_format -show_streams -of ini input.mp4

Understanding the Command Arguments

Saving the Metadata to a File

To export this metadata directly into a .ini file rather than printing it to the terminal screen, redirect the output using the standard command-line redirection operator (>):

ffprobe -v error -show_format -show_streams -of ini input.mp4 > metadata.ini

This command generates a structured metadata.ini file in your current working directory, categorized by sections like [format] and [streams.stream.0], which can be easily parsed by configuration readers in Python, Node.js, or other programming languages.