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.
A drained and empty Kennington reservoir images from a drone in early July 2024. The…
Merrimu Reservoir from drone. Click images to view larger.
Using FTP and PHP to get an array of file details such as size and…
Creating and using Laravel form requests to create cleaner code, separation and reusability for your…
Improving the default Laravel login and register views in such a simple manner but making…
Laravel validation for checking if a field value exists in the database. The validation rule…