Development

Getting video bitrate with FFprobe

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.

Share

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

1 year ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

1 year ago

FTP getting array of file details such as size using PHP

Using FTP and PHP to get an array of file details such as size and…

2 years ago

Creating Laravel form requests

Creating and using Laravel form requests to create cleaner code, separation and reusability for your…

2 years ago

Improving the default Laravel login and register views

Improving the default Laravel login and register views in such a simple manner but making…

2 years ago

Laravel validation for checking if value exists in the database

Laravel validation for checking if a field value exists in the database. The validation rule…

2 years ago