Codecs, bitrate control and GOP
H.264, H.265, AV1 and MJPEG; smart codecs like Axis Zipstream; CBR, VBR and MBR; GOP and frame types.
- Explain how inter-frame compression works (I- and P-frames, GOP)
- Compare H.264, H.265, AV1 and MJPEG and know when each fits
- Explain what a smart codec such as Axis Zipstream does
- Choose a bitrate control mode for a given requirement
Why compression matters
An uncompressed 1080p stream at 30 fps is roughly 1.5 Gbps (1920 ร 1080 pixels ร 24 bits ร 30 fps). A typical compressed surveillance stream at the same resolution is a few Mbps, so the codec is doing a few-hundred-to-one reduction. Codec choice and settings drive network load, storage cost and server count more than almost any other decision.
Frames and the group of pictures (GOP)
- I-frame (intra / key frame)
- A complete picture compressed on its own, like a JPEG. Large. Every playback or seek must start from one.
- P-frame (predicted)
- Stores only what changed since a previous frame using motion vectors. Small when the scene is static.
- B-frame (bi-predictive)
- References past and future frames. Saves bits but adds latency; many surveillance cameras do not use B-frames for live streams.
- GOP length
- Frames from one I-frame to the next. At 30 fps, GOP 30 = one I-frame per second. Some vendors express it as an I-frame interval in seconds.
Longer GOPs cut bitrate in quiet scenes, but playback has to decode from the previous I-frame, so seeking is slower and a corrupted frame affects more of the video. Many VMSs also use I-frames for thumbnails and fast-forward, so extremely long GOPs can make investigation tools feel sluggish.
The codecs
| Codec | Standard | Relative efficiency | Strengths | Watch out for |
|---|---|---|---|---|
| MJPEG | Sequence of independent JPEGs | Lowest (every frame is an I-frame) | Simple, every frame stands alone, very low decode latency, easy to extract stills | Very high bitrate and storage; rarely appropriate for continuous recording |
| H.264 / AVC | ITU-T H.264 | ISO/IEC 14496-10 | Baseline | Universal support in cameras, VMSs, browsers and hardware decoders | Higher bitrate than newer codecs at the same quality |
| H.265 / HEVC | ITU-T H.265 | ISO/IEC 23008-2 | Designed to roughly halve bitrate vs H.264 at equal quality; real-world surveillance savings vary by scene | Lower storage and bandwidth, especially at 4K | More decoding load on clients; patent licensing landscape is complex; check VMS, browser and mobile client support |
| AV1 | Alliance for Open Media (AOMedia) | Comparable to H.265 (per Axis' implementation) | Royalty-free intent, strong browser and WebRTC support, good fit for cloud and web clients | Newer in surveillance; requires camera SoC support (Axis: ARTPEC-9 or later) and VMS/client support |
Axis supports AV1 encoding on devices with the ARTPEC-9 system-on-chip or later (Main Profile, 8-bit). Axis states its AV1 implementation offers compression efficiency comparable with H.265, works with Zipstream and signed video, and is supported by VMS partners including Genetec and Milestone as well as AXIS Camera Station. Check each camera's datasheet: not every Axis model has ARTPEC-9.
Smart codecs: Axis Zipstream as the example
"Smart codec" technologies sit on top of H.264/H.265/AV1 and decide where to spend bits. They remain standards-compliant streams, so the VMS decodes them normally. Axis Zipstream is a well-documented example and consists of three algorithms:
| Zipstream feature | What it does |
|---|---|
| Dynamic ROI (region of interest) | Identifies regions with objects, people or motion and keeps forensic detail there while compressing static background harder. The ROI expands, shrinks and moves automatically. |
| Dynamic GOP | Sends bandwidth-heavy I-frames less often when there is no motion, extending the GOP up to a configurable maximum. |
| Dynamic FPS | Lowers the encoded frame rate in static scenes; the camera still captures and analyses at full frame rate and raises fps when motion appears. |
Axis recommends dynamic GOP and dynamic FPS when Zipstream strength is set to 30 or higher. Other manufacturers have their own smart-codec features; compare them by measuring bitrate on the same scene, not by datasheet percentages.
Smart codecs make bitrate scene-dependent. A quiet corridor may drop dramatically overnight while a busy lobby barely changes. Base storage estimates on measured averages from a pilot camera in a representative scene and keep headroom for busy periods.
Bitrate control modes
| Mode | Behaviour | Good for | Risk |
|---|---|---|---|
| CBR โ constant bitrate | Encoder holds a fixed bitrate; quality drops when the scene gets busy | Predictable network links (e.g. wireless backhaul), fixed-budget designs | Smearing/blockiness exactly when something happens |
| VBR โ variable bitrate | Encoder holds a quality (compression) level; bitrate rises and falls with scene complexity | Forensic quality on wired LANs | Bitrate spikes in rain, snow, night noise or busy scenes; harder to size storage |
| MBR โ maximum bitrate | VBR with a ceiling; quality is held until the cap is reached (Axis term) | Most enterprise designs: quality with a safety limit | Cap set too low behaves like CBR at the worst moments |
| ABR โ average bitrate (Axis) | Targets an average over a retention period, letting short peaks through | Hitting a storage budget over days/weeks | Requires the camera to plan over time; check VMS support |
What really drives bitrate
- Scene motion and complexity: trees, traffic, rain and crowds cost far more than an empty hallway.
- Noise in low light: sensor noise looks like motion to the encoder, so night bitrate often exceeds day bitrate. Good low-light sensors and noise reduction lower it.
- Resolution and frame rate: roughly proportional, but not linear; doubling fps rarely doubles bitrate because P-frames get smaller.
- Compression level / quality setting and GOP length.
- Overlays and timestamps add a small amount; privacy masks can reduce it.
Multiple streams
Most cameras can produce several simultaneous streams (for example a high-resolution recording stream and a low-resolution live stream). Security Center lets you assign stream usage such as live, recording, remote and low/high resolution to different streams, so operators watching a 16-tile wall do not pull 16 ร 4K streams. Design the streams on purpose; do not accept the default.
Common mistakes
- Using MJPEG for continuous recording and being surprised by the storage bill.
- Sizing storage from a daytime bitrate measurement only; night noise and weather can double it.
- Setting a GOP so long that seeking and thumbnails become painfully slow in investigations.
- Switching a site to H.265 or AV1 without checking that the VMS, mobile app, web client and video walls can decode it.
- Choosing CBR on a LAN and getting smeared video during the one incident that matters.
- Comparing smart codecs by marketing percentages instead of measured bitrate on the same scene.
Check your understanding
1.Which frame type can be decoded entirely on its own?
2.A camera runs at 30 fps with a GOP length of 60. How often is an I-frame sent?
3.Which bitrate mode holds quality but caps the bitrate at a ceiling?
4.Which Zipstream algorithm reduces how often I-frames are sent when the scene is static?
5.Why is night-time bitrate often higher than daytime bitrate?
6.Name two things to check before standardizing a site on H.265 or AV1.