Categories: 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…

2 years ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

2 years ago

Early September spring shots

Some early September spring shots from a bushwalk, It is still too early for wildflowers.

3 years ago

Cloning an NVMe to SK Hynix Platinum P41 NVMe

I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…

3 years ago

Using Laravel’s deleteDirectory to delete folders and their contents

If you ever needed a simple solution in Laravel to delete an entire directory and…

3 years ago

How to allow only 1 user to register in a Laravel application

How to enforce only one user to register or be registered in a Laravel web…

3 years ago