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_url]

PARAMETERS

-v level
    Set the verbosity level (e.g., quiet, panic, fatal, error, warning, info, verbose, debug, trace).

-show_format
    Show format-level information.

-show_streams
    Show stream-level information.

-show_chapters
    Show chapter information.

-show_programs
    Show program information.

-show_packets
    Show packet information.

-show_frames
    Show frame information.

-show_private_data
    Show private data.

-show_error
    Show detected errors.

-count_frames
    Count the number of frames per stream.

-count_packets
    Count the number of packets per stream.

-print_format format
    Set the output format (e.g., default, compact, csv, flat, json, xml).

-i input_url
    Specify the input file or URL.

-of format
    Alias for `-print_format`.

-read_intervals ranges
    Read only specified interval ranges.

-headers
    Set custom HTTP headers.

DESCRIPTION

The `ffprobe` command is a powerful command-line tool for analyzing multimedia files. It's part of the FFmpeg suite and provides detailed information about the format, codecs, bitrates, and other characteristics of audio, video, and image files. It's valuable for developers, system administrators, and anyone who needs to understand the technical details of media content. `ffprobe` reads multimedia streams and prints all available information, without actually decoding or encoding the media. It supports a wide range of input formats and output options. The output can be formatted for human readability or structured for programmatic use (e.g., JSON, XML). This allows for easy integration with scripting languages and other tools. `ffprobe` is particularly useful for validating media files, diagnosing playback issues, and extracting metadata for media management systems. It's an essential tool for anyone working with digital media.

CAVEATS

The accuracy of the information reported by `ffprobe` depends on the quality and completeness of the metadata embedded in the media file. Certain codecs or formats may not be fully supported.

EXIT STATUS

ffprobe exits with 0 if successful, and >0 if an error occurred.

EXAMPLES

Example 1: Show format information in JSON format:
ffprobe -v quiet -print_format json -show_format -i input.mp4

Example 2: Show stream information in XML format:
ffprobe -v quiet -print_format xml -show_streams -i input.avi

HISTORY

ffprobe is part of the FFmpeg project, a comprehensive suite of tools for handling multimedia content. The project was started in 2000 by Fabrice Bellard, and has grown into a widely used and highly respected open-source project. ffprobe has been developed alongside other FFmpeg tools like ffmpeg (for encoding/decoding) and ffplay (for playback) to provide a complete multimedia processing ecosystem. Its original focus was primarily on video processing, it now support several audio formats. It's usage has expanded in several different industries in the last few years.

SEE ALSO

ffmpeg(1), ffplay(1)

Copied to clipboard