Overview
ffprobe is a command-line tool for analyzing and inspecting multimedia streams. It can extract detailed information about media containers, codecs, streams, and metadata without performing any decoding or transcoding.
ffprobe is described as a “simple media prober based on the FFmpeg libraries” and was first released in 2007.
Basic Syntax
Common Options
Input file or URL to analyze
Set logging levelValues:
quiet, panic, fatal, error, warning, info, verbose, debug, traceCommon: -v quiet to suppress FFmpeg bannerHide FFmpeg banner (cleaner output)
Information Display Options
Show container format informationDisplays container details like duration, bitrate, format name, and tags
Show stream informationDisplays details about each stream including codec, resolution, framerate, and bitrate
Show program informationDisplays information about programs in the container
Show chapter informationLists chapters with their timestamps and metadata
Show packet informationDisplays detailed information about each packet (can be verbose)
Show frame informationDisplays information about each decoded frame
Show stream group information
Show packet/frame data payload
Show probing error information
Output Format Options
ffprobe supports multiple output formats for easy parsing and integration:Set output format (alias:
-print_format)Values:default- Default formatcompact- Compact outputcsv- CSV formatflat- Flat formatini- INI formatjson- JSON formatxml- XML format
JSON Output
XML Output
CSV Output
Stream Selection
Select specific streams to analyzeExamples:
v:0- First video streama:0- First audio streamv- All video streamsa- All audio streams
Frame/Packet Analysis
Read only specified intervalsFormat:
[START][%[END]]Example: -read_intervals "%+30" (first 30 seconds)Count the number of frames per stream
Count the number of packets per stream
Show only specified entriesExample:
-show_entries stream=width,height,codec_nameReal-World Examples
Basic Media Information
JSON Output for Parsing
Get Video Duration
Get Video Resolution
Get Audio Information
Get Video Bitrate
Get Framerate
Count Total Frames
Check for Specific Codec
Analyze Packets (First 100)
Get All Metadata
Pretty Print Stream Info
Advanced Usage
Custom Entry Selection
Multiple Formats
Stream Groups Analysis
Detailed Frame Analysis
Output Format Customization
You can customize the output format with additional options:Don’t print wrapper elementsExample:
-of default=noprint_wrappers=1Don’t print key namesExample:
-of default=nokey=1Example: Clean Duration Output
120.000000
Scripting Examples
Bash Script: Get Video Info
Python Script: Parse JSON Output
Use Cases
Media Validation
Verify media files meet specific requirements (codec, resolution, bitrate)
Metadata Extraction
Extract tags, duration, and other metadata for cataloging
Quality Assurance
Analyze encoded files for quality control
Automation
Integrate into scripts for batch processing and validation
Source Code Reference
Key implementation details from the source code:- Program Birth Year: 2007 (
fftools/ffprobe.c:93) - Section IDs: Comprehensive section structure for different output elements (
fftools/ffprobe.c:164-231) - Output Formats: Support for JSON, XML, CSV, INI, and custom formats (
fftools/ffprobe.c:256-326) - Stream Analysis: Detailed stream, packet, and frame analysis capabilities
Performance Tips
Common Options Summary
| Option | Purpose | Example |
|---|---|---|
-show_format | Container info | Basic file info |
-show_streams | Stream details | Codec, resolution |
-show_chapters | Chapter list | DVD/Blu-ray chapters |
-of json | JSON output | Machine parsing |
-select_streams v:0 | First video | Target specific stream |
-count_frames | Frame count | Total frames |
-v quiet | Suppress logs | Clean output |
See Also
- FFmpeg - Universal media converter
- FFplay - Multimedia player
- Additional Tools - Other utilities