3

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?

2

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.

  • I see, so is there any way to know the 'real' max_bit_rate? I need to know the value so that I can choose a suitable parameter for libx264 – shintaroid Jun 14 '17 at 1:39
  • Possible, but it requires some work. – Gyan Jun 14 '17 at 4:25
  • Great, thanks! Now I learned another ffmpeg trick! – shintaroid Jun 14 '17 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.