Extract Video Metadata in INI Format Using FFmpeg

This article explains how to use FFmpeg's companion tool, FFprobe, to extract comprehensive video metadata and format the output as an INI file. You will learn the exact command-line syntax, the meaning of each parameter, and how to save the resulting metadata directly to a .ini file for easy parsing and configuration management.

To extract video metadata in the INI format, you must use ffprobe, which is the stream analysis tool included with the FFmpeg installation.

The Command

Run the following command in your terminal or command prompt:

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

Command Breakdown

  • ffprobe: Invokes the FFmpeg multimedia stream analyzer.
  • -v error: Minimizes the console output by only displaying errors, preventing configuration headers and warnings from cluttering your data.
  • -show_format: Instructs the tool to extract container-level metadata (such as duration, file size, bit rate, and global tags).
  • -show_streams: Instructs the tool to extract detailed stream-level metadata for both video and audio tracks (such as codec, resolution, pixel format, and frame rate).
  • -print_format ini: Specifies that the output must be formatted as an INI configuration structure.
  • input.mp4: The path to your target video file.
  • > metadata.ini: Redirects the command-line output into a file named metadata.ini instead of printing it to the terminal screen.

Customizing the Output

If you only require specific metadata blocks rather than the entire file details, you can adjust the flags:

To extract container format metadata only:

ffprobe -v error -show_format -print_format ini input.mp4 > format_metadata.ini

To extract stream metadata only (video/audio properties):

ffprobe -v error -show_streams -print_format ini input.mp4 > stream_metadata.ini