Video Bitrate and FFmpeg Command Builder
Enter the target size and duration or choose CRF mode, pick codec and resolution, and copy the FFmpeg command with the right bitrate.
Runs in your browser. Your files never leave your device. See how to check
…
How to do it
- 1Choose the goal
Target size or quality.
- 2Enter size and duration
For size mode.
- 3Choose codec and resolution
And frame rate.
- 4Copy the commands
Run them in a terminal.
- 5Check the result
Adjust if needed.
About this tool
Email and chat apps limit attachment size, and many platforms reject large uploads. To fit a video into a size limit, you need the right bitrate: file size in bits divided by duration, minus the audio. FFmpeg, the free command-line tool behind most video software, can encode to that bitrate in two passes for the best quality, or encode by constant rate factor (CRF), which targets a quality level instead of a size. This builder does the arithmetic and writes the commands for you.
Who this is for
Content creators, teachers sharing lectures, developers compressing assets, and anyone who has hit a 25 MB attachment limit.
Size-based encoding
Video bitrate (kbps) = target size (MB) × 8,000 / duration (s) − audio bitrate. A 3 minute 20 second clip that must fit in 25 MB with 128 kbps audio needs about 872 kbps of video. Two-pass encoding analyses the video first, then spends bits where they matter, giving the best quality for that size.
Quality-based encoding (CRF)
CRF keeps quality roughly constant and lets size vary. Lower values mean higher quality. Typical defaults: 23 for x264 (range 18 to 28), 28 for x265, around 35 for SVT-AV1 and 31 for VP9 with constant quality. Raise the CRF by 6 to roughly halve the size.
Resolution and bits per pixel
Bits per pixel = bitrate / (width × height × frame rate). Below about 0.04 for H.264, fine detail breaks up; the calculator warns you so you can lower the resolution, for example from 1080p to 720p, which often looks better at low bitrates.
Codecs
H.264 plays everywhere. H.265 saves 30% to 50% for the same quality but is not supported by every browser. AV1 is the most efficient and widely supported in modern browsers, but slow to encode. VP9 in WebM suits web pages.
A worked example
For a 3:20 clip at 1080p and 25 MB, the builder gives 872 kbps video plus 128 kbps AAC audio and two FFmpeg commands. Bits per pixel is low, so 720p is suggested for better quality.
Running the commands
Install FFmpeg, open a terminal in the folder with your video, paste the first command, then the second. On Windows replace /dev/null with NUL.
## Choosing a preset speed The -preset option trades encoding speed for efficiency. slow or slower give smaller files at the same quality; fast or veryfast encode quickly. For a one-off compression, medium is a good balance; for archives, use slow.
## Audio settings 128 kbps AAC is fine for speech and most music; 96 kbps is enough for talks, and 192 kbps suits music videos. Mono audio halves the need for speech-only content.
Limits
Real sizes vary by a few per cent. Container overhead is small but not zero. General guidance, not a guarantee.
Worked example
25 MB for a 3:20 clip with 128 kbps audio needs about 872 kbps of video.
Quick facts
- Category: Audio, Video & Design
- Works in your browser, no sign-up, no upload.
- Your input stays on your device.
- Available in English.
- Content last reviewed:
- Official source: FFmpeg encoding guides for H.264, H.265, AV1 and VP9
Frequently asked questions
How is the bitrate calculated?
Target size × 8,000 / duration in seconds, minus the audio bitrate.
What is CRF?
Constant rate factor: a quality target; lower is better quality and larger files.
Why two passes?
The first pass analyses the video so the second spends bits where needed.
Which codec should I use?
H.264 for compatibility, H.265 or AV1 for smaller files.
What does the bits-per-pixel warning mean?
The bitrate is low for the resolution; try a lower resolution.
Is my video uploaded?
No. This page only builds commands; nothing is uploaded.
