user18532: I have an MP4 file input.mp4 which is encoded in libx264. By ffprobe command:
ffprobe -v error -show_streams input.mp4

I can know the bit rate of input.mp4, but it does not give the information of max bit rate (max_bit_rate=N/A ).
Is there any ffmpeg (ffprobe) command for getting max bit rate of a video?

user525: I wrote a simple tool to do this, called ffmpeg-bitrate-stats. It requires Python and ffmpeg installed. Install it via pip:
pip3 install --user ffmpeg-bitrate-stats

Then run it on a file:
ffmpeg_bitrate_stats /path/to/file.mp4

It will output a valid JSON object containing summary statistics like the maximum bitrate:
{
    "input_file": "file.mp4",
    "stream_type": "video",
    "avg_fps": 23.976,
    "num_frames": 150802,
    "avg_bitrate": 2249.534,
    "avg_bitrate_over_chunks": 2244.912,
    "max_bitrate": 2993.706,
    "min_bitrate": 1865.406,
    "max_bitrate_factor": 1.331,
    "bitrate_per_chunk": [
        2433.07,
        2329.958,
        2171.362,
        2227.863,
        2470.798,
        1978.106,
        2089.184,
        2993.706,
        1988.095,
        1865.406,
        2146.482
    ],
    "aggregation": "time",
    "chunk_size": 600.0,
    "duration": 6289.65
}

The maximum bitrate in the above file would be roughly 3000 kBit/s (max_bitrate). It is 1.3⨉ as much as the average bitrate (max_bitrate_factor).
Note that the meaning of maximum bitrate depends on the time frame over which it is calculated. You can calculate the bitrate every second (the default in my tool), or choose a different chunk size with the -c parameter. This means you'll get "smoothed" estimates, for instance when you set -c 10, it only looks at 10 second chunks of video, and picks the maximum based on that.
To just obtain that value, you can use jq:
ffmpeg_bitrate_stats /path/to/file.mp4 -c 600 | jq -r '.max_bitrate'


user37163: See https://github.com/zeroepoch/plotbitrate
It uses ffprobe under the hood and can output an xml file. Here's an example output.svg:

(Although it is slow - almost as slow as transcoding, because it scans the whole video.)

user1871: That max_bit_rate is a a tag written by some encoders, when set by the user in the export dialog box. It is not an indication of the maximum bitrate found if you were to survey the encoded bitstream.

It's possible to get a good idea of the maximum bitrate of a stream this way:
ffmpeg -i in.mp4 -map 0:v -c copy
       -f segment -segment_time 1 -break_non_keyframes 1 folder\seg%d.264

This will break up the video stream into 1 second segments. Sort the directory listing by size to find out the largest file. That's your maximum bitrate. Not totally accurate as it's not a rolling survey but should be close enough.

18532: <p>I have an <code>MP4</code> file <code>input.mp4</code> which is encoded in <code>libx264</code>. By <code>ffprobe</code> command:</p>

<pre><code>ffprobe -v error -show_streams input.mp4
</code></pre>

<p>I can know the bit rate of <code>input.mp4</code>, but it does not give the information of <code>max bit rate</code> (<code>max_bit_rate=N/A</code> ).</p>

<p>Is there any <code>ffmpeg</code> (<code>ffprobe</code>) command for getting <code>max bit rate</code> of a video?</p>
 525: <p>I wrote a simple tool to do this, called <a href="https://github.com/slhck/ffmpeg-bitrate-stats" rel="nofollow noreferrer"><code>ffmpeg-bitrate-stats</code></a>. It requires Python and <code>ffmpeg</code> installed. Install it via <code>pip</code>:</p>
<pre><code>pip3 install --user ffmpeg-bitrate-stats
</code></pre>
<p>Then run it on a file:</p>
<pre><code>ffmpeg_bitrate_stats /path/to/file.mp4
</code></pre>
<p>It will output a valid JSON object containing summary statistics like the maximum bitrate:</p>
<pre class="lang-json prettyprint-override"><code>{
    &quot;input_file&quot;: &quot;file.mp4&quot;,
    &quot;stream_type&quot;: &quot;video&quot;,
    &quot;avg_fps&quot;: 23.976,
    &quot;num_frames&quot;: 150802,
    &quot;avg_bitrate&quot;: 2249.534,
    &quot;avg_bitrate_over_chunks&quot;: 2244.912,
    &quot;max_bitrate&quot;: 2993.706,
    &quot;min_bitrate&quot;: 1865.406,
    &quot;max_bitrate_factor&quot;: 1.331,
    &quot;bitrate_per_chunk&quot;: [
        2433.07,
        2329.958,
        2171.362,
        2227.863,
        2470.798,
        1978.106,
        2089.184,
        2993.706,
        1988.095,
        1865.406,
        2146.482
    ],
    &quot;aggregation&quot;: &quot;time&quot;,
    &quot;chunk_size&quot;: 600.0,
    &quot;duration&quot;: 6289.65
}
</code></pre>
<p>The maximum bitrate in the above file would be roughly 3000 kBit/s (<code>max_bitrate</code>). It is 1.3⨉ as much as the average bitrate (<code>max_bitrate_factor</code>).</p>
<p>Note that the meaning of <em>maximum bitrate</em> depends on the time frame over which it is calculated. You can calculate the bitrate every second (the default in my tool), or choose a different chunk size with the <code>-c</code> parameter. This means you'll get &quot;smoothed&quot; estimates, for instance when you set <code>-c 10</code>, it only looks at 10 second chunks of video, and picks the maximum based on that.</p>
<p>To just obtain that value, you can use <code>jq</code>:</p>
<pre><code>ffmpeg_bitrate_stats /path/to/file.mp4 -c 600 | jq -r '.max_bitrate'
</code></pre>
 37163: <p>See <a href="https://github.com/zeroepoch/plotbitrate" rel="nofollow noreferrer">https://github.com/zeroepoch/plotbitrate</a></p>
<p>It uses <code>ffprobe</code> under the hood and can output an xml file. Here's an example output.svg:</p>
<p><a href="https://i.stack.imgur.com/ugIED.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ugIED.png" alt="enter image description here" /></a></p>
<p>(Although it is slow - almost as slow as transcoding, because it scans the whole video.)</p>
 1871: <p>That <code>max_bit_rate</code> is a a tag written by some encoders, when set by the user in the export dialog box. It is not an indication of the maximum bitrate found if you were to survey the encoded bitstream.</p>

<hr>

<p>It's possible to get a good idea of the maximum bitrate of a stream this way:</p>

<pre><code>ffmpeg -i in.mp4 -map 0:v -c copy
       -f segment -segment_time 1 -break_non_keyframes 1 folder\seg%d.264
</code></pre>

<p>This will break up the video stream into 1 second segments. Sort the directory listing by size to find out the largest file. That's your maximum bitrate. Not totally accurate as it's not a rolling survey but should be close enough.</p>
