
CBR vs VBR is a choice of what your encoder holds fixed. CBR keeps the bitrate steady, while VBR moves bits from easy scenes to hard ones around an average. CRF fixes quality and lets bitrate float. Use CBR for live ingest and capped VBR or CRF for VOD.
TL;DR:
Rate control is the part of an encoder that decides how many bits each frame gets. Bitrate is your budget and rate control is the spending policy, which is why our guide to how video encoding, codecs and bitrate fit together treats them as one step. The common modes differ in which value you set and which one the encoder may change.
On the x264 CRF scale, 0 is lossless, 23 is the default and 51 is the worst. The FFmpeg wiki calls 17 to 28 the sane range, and adding 6 roughly halves the bitrate. The x265 default is 28, which the wiki says looks like x264 at 23 at about half the size. Our video streaming glossary keeps one-line definitions of CBR, CRF and the other encoding terms.
In FFmpeg, three switches control bitrate for x264 and x265: -b:v sets the average, -maxrate the ceiling and -bufsize the size of the video buffering verifier (VBV). The VBV models a decoder buffer that fills at maxrate. So the encoder can burst above maxrate for a moment while the modelled buffer has room, and a single second can land well over the cap.
These are the four commands we ran for the test below. We fed them a PNG frame sequence, so swap in your own input file:
# CBR: target, minimum and maximum all equal
ffmpeg -i input.mp4 -c:v libx264 -b:v 2500k -minrate 2500k -maxrate 2500k \
-bufsize 2500k -x264-params nal-hrd=cbr cbr.ts
# Two-pass constrained VBR (200%): pass 1 measures, pass 2 encodes
ffmpeg -i input.mp4 -c:v libx264 -b:v 2500k -maxrate 5000k -bufsize 5000k -pass 1 -f mp4 /dev/null
ffmpeg -i input.mp4 -c:v libx264 -b:v 2500k -maxrate 5000k -bufsize 5000k -pass 2 vbr.mp4
# CRF: quality target, no bitrate target
ffmpeg -i input.mp4 -c:v libx264 -crf 23 crf23.mp4
# Capped CRF: quality target with a 2,500 kbps ceiling
ffmpeg -i input.mp4 -c:v libx264 -crf 23 -maxrate 2500k -bufsize 5000k capped.mp4All four used the medium preset and a keyframe every 60 frames (-g 60). The FFmpeg wiki warns that libx264 doesn't strictly hold a maximum rate, and you'll see that in the numbers.
We built a 20-second, 1280x720, 30 fps test clip: 10 seconds of a static gradient with a slow box, then 10 seconds of panning fine detail with fresh grain on every frame. We encoded it with libx264 in FFmpeg n7.1 on 2026-10-29, read packet sizes with ffprobe and computed luma PSNR against the source frames.

| Mode | Average kbps | Easy half | Hard half | Peak 1 s window | Hard-half PSNR |
|---|---|---|---|---|---|
| CBR 2,500k | 2,515 | 2,476 | 2,554 | 4,138 | 32.4 dB |
| Two-pass VBR 2,500k, 200% | 2,440 | 86 | 4,795 | 7,690 | 34.7 dB |
| CRF 23 | 1,427 | 73 | 2,781 | 5,693 | 34.0 dB |
| Capped CRF 23, 2,500k cap | 1,212 | 73 | 2,351 | 4,799 | 33.3 dB |
CBR and VBR both landed near 2,500 kbps, but VBR moved almost everything into the hard half and bought 2.3 dB of PSNR there. Meanwhile CBR spent 2,476 kbps on a gradient that CRF encoded at 73 kbps, and both scored above 55 dB there. The FFmpeg wiki makes the same point: CBR encodes are usually inefficient when the video is easy to encode.
The caps also leaked. VBR hit 7,690 kbps in one second against a 5,000k maxrate, and capped CRF averaged 2,918 kbps over one 2-second window against its 2,500k cap. That's the loose cap the FFmpeg wiki warns about, so plan your viewers' headroom around the measured peak.
CRF used 43% fewer bits than CBR and still scored higher on the hard half, but you couldn't know its bitrate until the encode finished. These numbers come from one synthetic clip and one run, scored with PSNR, so treat them as directional. This FFmpeg build has no libvmaf, so we couldn't add VMAF, the perceptual quality score. Jan Ozer's OTTVerse tests on real footage point the same way: on a football clip, CBR's lowest-frame VMAF was 79.76 against 85.39 for 200% constrained VBR.
Pick the mode by the one thing you can't let vary.
Rate control matters for adaptive bitrate streaming too, because the player picks renditions from the BANDWIDTH value in the playlist. Apple requires a VOD rendition's measured peak to sit within 10% of that value, so write the measured peak there.
For video on demand, you set rate per rendition in the qualities array of a create-video request. Each video_config carries a codec (h264 or h265) and a bitrate that the docs define as the target video bitrate in bits per second. Each resolution has a documented ceiling: 4,000,000 bps at 720p, 6,000,000 at 1080p and 30,000,000 at 2160p. This example is quoted from the docs and not run here:
POST https://api.aiozstream.network/api/media/create
{
"title": "My Video",
"type": "video",
"qualities": [
{
"resolution": "1080p",
"type": "hls",
"container_type": "mpegts",
"video_config": { "codec": "h264", "bitrate": 5000000, "index": 0 }
},
{
"resolution": "720p",
"type": "hls",
"container_type": "mpegts",
"video_config": { "codec": "h264", "bitrate": 3000000, "index": 0 }
}
]
}Our docs don't name the rate control mode the transcoder applies to that target, so if peak behavior matters to you, run ffprobe on a finished rendition. The codec limits (H.264 up to 4K, H.265 up to 8K) are in our 4K and 8K encoding walkthrough, and segment containers are compared in MPEG-TS vs fMP4 for HLS segments.
For live, our OBS guide sets Rate Control to CBR at 4,500 to 6,000 Kbps with a 1 second keyframe interval for 1080p30, on both NVENC and x264. The livestream statistic endpoint then reports bitrate_in and bitrate_out in Kbps, updated every 5 to 30 seconds (quoted from the docs, not run here):
curl --location 'https://api.aiozstream.network/api/live_streams/statistic/stream_media_id' \
--header 'Authorization: Bearer your_access_token_here'Next step: set video_config.bitrate per quality in the AIOZ Stream Video API reference.
Is VBR better than CBR?
For on-demand video, yes: at the same average bitrate it gives hard scenes more bits, which raised hard-scene PSNR by 2.3 dB in our test. For live ingest, CBR is safer because your uplink can't absorb spikes.
Is CRF the same as VBR?
CRF is a quality-targeted form of variable bitrate, but it has no bitrate target, so you only learn the file size after encoding.
What CRF value should I use?
Start at the x264 default of 23 and move within 17 to 28; for x265 the default is 28.
Should I use CBR or VBR in OBS?
Use CBR, which is what the AIOZ Stream OBS guide specifies and what Wowza recommends for live streaming.
Why is my CBR stream not perfectly flat?
The VBV buffer lets the encoder borrow and repay bits, so short windows swing around the target; our CBR encode ranged from 2,336 to 2,766 kbps per 2-second window.

MPEG-DASH streams adaptive video over HTTP from an XML MPD file. See a real MPD: Periods, AdaptationSets, Representations, segment addressing and live MPDs.

What is CMAF? The ISO format that packages video as fragmented MP4 so one set of files serves HLS and DASH, with its chunks, brands and low-latency role.

CBR vs VBR vs CRF explained: what each video rate control mode holds fixed, how maxrate and bufsize cap it, our x264 test results, and which mode to use where.

A live streaming API tutorial for AIOZ Stream: create a session, push RTMP, poll real-time stats every 5 to 30 seconds, then list the saved recordings.

Restream to multiple platforms by sending one feed to a relay. Learn the bandwidth math, platform rules and how AIOZ Stream multicast forwards your RTMP stream.

MPEG-TS vs fMP4 for HLS: how 188-byte TS packets and fMP4 init segments differ, what each costs in overhead, which codecs need fMP4, and when TS still fits.