Development

FFmpeg set video bitrate amount for encode

To set a bitrate for a video encode in FFmpeg use -b:v which means bitrate for video, then specify the bitrate value. This can be k for kBits or m for megabits, -b:v 2M is 2 Megabits.

An example for a 3 Megabit video bitrate is

ffmpeg -i in.mp4 -b:v 3M out.mp4

As an extra you can also specify the audio bitrate using -b:a

A working example with this in use is

ffmpeg -i in.mp4 -b:v 2M -b:a 124K out.mp4

Using this method is a one pass encode which is not efficient, making using -crf a better approach (see here).

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