A simple method to get the bitrate of a video using FFprobe which comes with FFmpeg.
The command:
ffprobe -v quiet -select_streams v:0 -show_entries stream=bit_rate -of default=noprint_wrappers=1 inputvideo.mp4
-v quiet
sets the log level as quiet meaning show no logs.
-select_streams v:0
selects the first video stream, if you have multiple video streams use this to target the one you want. Removing this means the bitrate will be shown for all video streams.
-show_entries stream=bit_rate
show the bitrate value.
-of default=noprint_wrappers=1
format as default with don’t print section and header.
The output will be in bits eg:
bit_rate=5469007
To get this as Kbps divide by 1000:
5469007 / 1000 = 5469.007
Now for Mbps divide the Kbps by 1000:
5469.007 / 1000 = 5.469007
Therefore the input video has a bitrate of 5,469 Kbps or 5.47 Mbps.