How to List Stream Bitrates with ffprobe

Extracting the bitrate of individual video, audio, and subtitle streams is a common task when analyzing media files. This guide shows you how to use ffprobe, a powerful command-line utility bundled with FFmpeg, to quickly inspect and list the precise bitrates of every individual stream within a media container.

The Standard ffprobe Command

To list the index, codec type, and bitrate of all streams in a media file, use the following command in your terminal:

ffprobe -v error -show_entries stream=index,codec_type,bit_rate -of default=noprint_wrappers=1 input.mp4

Command Breakdown:


Outputting in JSON Format

If you are parsing the data in a script or prefer a structured layout, you can format the output as JSON:

ffprobe -v error -show_entries stream=index,codec_type,bit_rate -of json input.mp4

This will return a clean JSON object resembling this:

{
    "programs": [],
    "streams": [
        {
            "index": 0,
            "codec_type": "video",
            "bit_rate": "4500000"
        },
        {
            "index": 1,
            "codec_type": "audio",
            "bit_rate": "192000"
        }
    ]
}

Handling “N/A” Bitrates (MKV and other containers)

Certain file formats (like MKV, WebM, or raw streams) do not always store the stream bitrate in the main header. In these cases, ffprobe may display N/A for the bitrate. You can work around this in two ways:

Method 1: Check Stream Tags

Many modern multiplexers write bitrate information into the metadata tags. You can query these tags specifically:

ffprobe -v error -show_entries stream_tags=BPS -of default=noprint_wrappers=1 input.mkv

Method 2: Calculate via Packet Analysis (Accurate but Slower)

If the metadata does not exist, you can force ffprobe to analyze the packets of the file to calculate the exact bitrate of each stream:

ffprobe -v error -show_entries packet=stream_index,size -of csv input.mkv

Note: This outputs the size of every packet and its corresponding stream index, which you can sum up and divide by the duration to find the exact average bitrate.