CBR, VBR and Smart Codecs: How to Set Camera Bitrate

The difference between CBR, VBR and capped VBR on IP cameras, GOP and I-frame interval, smart codec behavior, night-time noise and measuring the real bitrate with ffprobe.
Technical summary
Technology
H.264, H.265, CBR, VBR, GOP, smart codec, ffmpeg, ffprobe
Topic
Rate control and GOP settings in camera streams
Level
Intermediate
Prerequisites
  • Admin access to the camera web interface
  • The camera’s RTSP stream address
  • Basic H.264/H.265 concepts
In this article8 sections

The same camera, at the same resolution and with the same codec, can produce 2 Mbps with one setting and 8 Mbps with another. This difference directly determines retention time, network load and image quality at the moment of an incident. In this guide we explain the rate control modes within the chosen codec, GOP and I-frame interval, the real behavior of smart codecs and how to measure whether your settings are right. Comparing H.265 and H.264 is a separate topic; we covered it in the H.265 vs H.264 recording performance guide.

Bitrate control modes

The encoder decides how much to compress each frame based on the rate control mode and the quality parameter. Manufacturers give the modes different names, but the behavior falls into three groups:

Mode Behavior Advantage Limitation
CBR (constant) Bitrate is held at the target value Network and storage fully predictable Wastes bandwidth in calm scenes; quality drops in busy scenes
VBR (variable) Quality is held constant; bitrate varies with the scene Marked savings in calm scenes Unexpected increases in busy scenes or at night
Capped VBR Quality is targeted; bitrate doesn’t exceed a cap Savings and predictability together Degradation in busy scenes if the cap is set too low

Some manufacturers add an average bitrate (ABR) mode: the camera targets an average over a given period and allows short peaks. It’s useful in projects where retention time must be met. It has a cost too: bits spent on a short, intense event are deducted from the quality of the following minutes.

For recording in enterprise camera systems, our default recommendation is capped VBR. Set the cap slightly above the value you measure during the scene’s real busy moments. Do the capacity calculation with the average value and account for the night value separately.

GOP and I-frame interval

H.264 and H.265 streams consist of I-frames, which carry a full image, and P-frames (B-frames in some profiles), which carry only the change. GOP (Group of Pictures) length is the number of frames between two I-frames. An I-frame is many times larger than a P-frame, which is why GOP length directly affects bitrate.

  • Short GOP (e.g. 25 frames at 25 fps, i.e. one I-frame per second): Fast seeking during playback, fast recovery after packet loss; higher bitrate.
  • Long GOP (e.g. 50–100 frames at 25 fps): Marked savings in static scenes; seeking and the arrival of the first image in live view are delayed.
  • Dynamic GOP: The camera lengthens the GOP when there’s no motion in the scene and shortens it when motion starts. It’s a core component of smart codec technologies.

A practical starting point is setting the GOP to 1–2 times the frame rate. A common mistake: the frame rate is lowered but the GOP is left the same in frames. If a GOP of 50 at 25 fps isn’t brought down to around 24 when moving to 12 fps, the I-frame interval rises to about 4 seconds. Because motion detection or export in some VMSs works on I-frame boundaries, a very long GOP can cause the start of an event to be captured a few seconds late. The lost seconds are usually the most valuable ones.

How smart codecs work

Manufacturers’ smart codec technologies (e.g. Axis Zipstream, Hanwha WiseStream, Hikvision H.265+, Dahua Smart H.265+) differ in detail but rest on the same ideas:

  1. Regional quality: Areas of the scene with motion or interest are kept at high quality, and the static background is compressed more aggressively.
  2. Dynamic GOP: The I-frame interval is lengthened during periods without motion.
  3. Background reference: Some implementations keep the static background as a reference frame and encode subsequent frames against it.
  4. Dynamic frame rate: Some implementations also lower the frame rate in motionless scenes.

The gain depends entirely on the scene. It’s large in an empty corridor and limited on a road with constant traffic. In the capacity calculation, use the value you measure in your own scene, not the savings rate in the manufacturer’s brochure. Test the side effects of smart codecs separately on streams going to an analytics server or a third-party VMS; in that case, dedicating a separate stream to analytics is a common solution. We explained the division of roles between streams in the camera multi-streaming and stream profiles guide.

Settings table by scene type

The values below are example starting points for a 4 MP, H.265 main stream, not measurement results. Correct them by measuring on site.

Scene FPS Mode / GOP Starting cap
Calm indoor (corridor, warehouse rack) 12–15 Capped VBR, dynamic GOP 2 Mbps
Busy entrance, checkout, lobby 15–20 Capped VBR, GOP = 2×FPS 4 Mbps
Outdoor, trees and rain movement 12–15 Capped VBR, GOP = 1–2×FPS 4–6 Mbps
Vehicle entrance, plate reading 25 Capped VBR, GOP = 1×FPS 6 Mbps
Limited link (wireless bridge, 4G) 8–12 CBR or ABR According to link capacity

Night-time noise and bitrate increase

In low light, the camera raises gain (signal amplification). Sensor noise added to the image is fine detail that changes randomly in every frame; the encoder mistakes it for motion and can’t compress it. In VBR mode, the night bitrate rises to several times the daytime value; with CBR or a low-capped VBR, the image becomes blocky. Neither outcome is wanted.

The order of steps for controlling night bitrate matters:

  1. Fix the light: Additional lighting or aiming IR coverage at the right angle reduces the need for gain. This is the most effective and lasting solution.
  2. Limit maximum gain: Reduces the noise source directly, but the image gets darker. Set the limit according to the target image level at night.
  3. Use noise reduction (3D DNR) in moderation: It suppresses noise and lowers bitrate; at high levels it leaves trails and blur on moving objects.
  4. Review the shutter limit: A longer exposure reduces the need for gain but increases motion blur. Details are in the camera exposure, shutter and gain settings guide.
  5. Set the bitrate cap last: Based on the value you measure at night.

In the storage calculation, account for night hours and night bitrate separately. A calculation based on the daytime value is the most common reason retention time isn’t met in the winter months. In December, the disk fills early.

Measuring the balance between quality and storage

The instantaneous bitrate shown in the camera interface can be misleading. To find the real value, record the stream for a while and measure the file. Taking a 10-minute sample with FFmpeg tools is enough:

# Record 10 minutes from the main stream without re-encoding
ffmpeg -rtsp_transport tcp -i "rtsp://user:[email protected]:554/stream1" \
  -c copy -t 600 sample.mkv

# Average bitrate (bit/s), duration and file size
ffprobe -v error -show_entries format=duration,size,bit_rate \
  -of default=noprint_wrappers=1 sample.mkv

# List frame types to see the I-frame interval
ffprobe -v error -select_streams v:0 -show_entries frame=pict_type \
  -of csv=p=0 sample.mkv | grep -n I | head

The RTSP path varies by camera manufacturer; get the correct address from the camera documentation or via ONVIF. Daily storage needs follow simply from the measurement: GB/day ≈ Mbps × 10.8. A stream averaging 3 Mbps takes up about 32.4 GB per day.

You can set up the measurement plan like this:

  • Take three samples for at least one camera of each scene type: busy daytime hours, calm daytime hours and night.
  • Compare the same samples with different settings (e.g. two different caps) and judge the image against the target image level: can the plate be read, can the face be recognized?
  • A few days later, check the average bitrate per camera reported by the VMS with the chosen settings.
  • Update the capacity calculation with the measured averages. The calculation method is in the how many days does an NVR record guide.

Common settings mistakes

  • Applying the same bitrate template to all cameras; calm and busy scenes need different values.
  • Lowering the frame rate and leaving the GOP value the same in frames.
  • Not defining a cap in VBR and not including the night-time increase in the capacity plan.
  • Using VBR on a bandwidth-limited link and suffering packet loss at busy moments.
  • Enabling a smart codec on all cameras without testing it with the third-party VMS and analytics.
  • Setting the quality parameter to maximum and capping bitrate low. The encoder can’t meet both targets at once.
  • Not checking whether settings reverted to defaults after a firmware update.

To plan camera settings together with recording capacity, see our recording storage and capacity planning service; to review the settings and recording policies of existing NVRs, see our NVR recording system installation and management service. All options of the measurement commands are in the ffprobe documentation.

Frequently asked questions

Is CBR or VBR better for recording?

In most recording scenarios, capped VBR is more efficient: it saves storage in calm scenes, preserves quality in busy scenes, and thanks to the cap, the network and capacity plan isn’t upset. Use CBR on links with strictly limited bandwidth or with legacy systems that expect a constant bitrate.

Does lengthening the I-frame interval lower quality?

In a static scene it doesn’t cause noticeable quality loss and it reduces storage. However, seeking during playback, a newly joining client getting its first image and the image recovering after packet loss are delayed because they wait for the I-frame.

Does a smart codec work with every VMS?

Most smart codecs produce a standard H.264 or H.265 bitstream. However, dynamic GOP and variable frame rate can affect search, motion detection or analytics behavior in some third-party VMSs. Verify compatibility with your VMS version from the manufacturer’s documentation and test on site.

How do you reduce the bitrate increase at night?

First fix scene lighting or IR coverage, then limit maximum gain and use digital noise reduction (3D DNR) at a reasonable level. If these steps are skipped and only the bitrate cap is lowered, the night image becomes blocky.

Support

Contact us for support or a discovery session on this topic.

Contact form
[email protected]

Eretek Video Surveillance

IP cameras, recording and central management infrastructure. We plan blind spots, retention periods and the camera network around the risks of each site.

Knowledge Center

Other articles