LinuxCommandLibrary

ffprobe

Get multimedia file information

TLDR

Display all available stream info for a media file

$ ffprobe [[-v|-loglevel]] error -show_streams [input.mp4]
copy

Display media duration
$ ffprobe [[-v|-loglevel]] error -show_entries format=duration [[-of|-output_format]] default=noprint_wrappers=1:nokey=1 [input.mp4]
copy

Display the frame rate of a video
$ ffprobe [[-v|-loglevel]] error -select_streams v:0 -show_entries stream=avg_frame_rate [[-of|-output_format]] default=noprint_wrappers=1:nokey=1 [input.mp4]
copy

Display the width or height of a video
$ ffprobe [[-v|-loglevel]] error -select_streams v:0 -show_entries stream=[width|height] [[-of|-output_format]] default=noprint_wrappers=1:nokey=1 [input.mp4]
copy

Display the average bit rate of a video
$ ffprobe [[-v|-loglevel]] error -select_streams v:0 -show_entries stream=bit_rate [[-of|-output_format]] default=noprint_wrappers=1:nokey=1 [input.mp4]
copy

SYNOPSIS

ffprobe [options] [{input_file|-}]

PARAMETERS

-v <level>
    Set logging verbosity (quiet/panic/fatal/error/warning/info/verbose/debug/trace).

-loglevel <level>
    Alias for -v; sets logging level.

-show_entries <entry_list>
    Specify entries to display (e.g., 'format=duration:size').

-select_streams <spec>
    Select streams (e.g., 'v:0' for first video).

-show_format
    Display container format info.

-show_streams
    Show details for all streams.

-show_programs
    Display program info.

-show_chapters
    Show chapter information.

-show_packets
    Display packet details.

-show_frames
    Show frame information.

-print_format <format>
    Output format: xml/json/csv/flat/ini/compact.

-of <format>
    Alias for -print_format.

-i <file>
    Specify input file or URL.

-f <format>
    Force input format.

-pretty
    Prettify XML/JSON output.

-unit
    Display values with units (e.g., 'kHz').

-read_intervals <intervals>
    Read only specified time intervals.

-count_frames
    Count frames in streams.

-count_packets
    Count packets in streams.

-show_private_data
    Include private stream data.

-hide_banner
    Suppress info banner.

DESCRIPTION

ffprobe is a command-line tool from the FFmpeg project used to analyze and display detailed information about multimedia files. It extracts metadata on containers, audio/video streams, chapters, programs, packets, frames, and more, without performing transcoding or playback.

Ideal for developers, system administrators, and media professionals, it helps in debugging encoding problems, scripting automation, verifying file properties, or generating reports. ffprobe supports thousands of formats and codecs via FFmpeg libraries like libavformat and libavcodec.

Output is customizable with formats like XML (default), JSON, CSV, flat text, or INI, making it parseable for tools or databases. Features include stream selection, interval reading, counting frames/packets, private data display, and protocol support (HTTP, RTSP, etc.). It's efficient, probing only necessary data.

Common use cases: check video resolution/bitrate, list subtitles, inspect packet structure, or confirm compatibility before processing with ffmpeg. Lightweight and cross-platform, ffprobe runs on Linux, macOS, Windows.

CAVEATS

Probing may consume memory for large files; some formats require full scan. Private/proprietary data often hidden. Does not decode unknown codecs fully.

COMMON EXAMPLES

ffprobe video.mp4
Default XML output with full info.

ffprobe -v error -show_entries format=duration:size -of default=noprint_wrappers=1:nokey=1 input.mkv
Prints only duration and size.

ffprobe -loglevel quiet -print_format json -show_format -show_streams file.avi
JSON stream/format details.

OUTPUT FORMATS

Supports xml (default, human-readable), json (structured), csv (tabular), flat (key=value), ini (sections). Use -print_format csvp for CSV with headers.

HISTORY

Introduced in FFmpeg 0.6 (March 2010) by the FFmpeg project, founded in 2000 by Fabrice Bellard as a fork of libavcodec. Evolved with FFmpeg's growth to support 1000+ formats; now essential for media analysis in CI/CD pipelines and forensics.

SEE ALSO

ffmpeg(1), ffplay(1)

Copied to clipboard