A codec (coder-decoder) is the compression standard used to shrink video for transmission and storage, and to reconstruct it for viewing. Raw video from a camera sensor is enormous; a codec encodes it into a fraction of the size at the camera, and the VMS or client decodes it back into viewable frames. In surveillance the dominant codecs are H.264 (AVC) and H.265 (HEVC), with AV1 emerging and older MJPEG lingering for special cases.
The codec choice is one of the biggest cost levers in a system because it sets how many bits each camera spends. H.265 roughly halves the bitrate of H.264 for similar quality — decisive at 4K or across hundreds of cameras — while MJPEG (every frame compressed independently, no inter-frame savings) produces large files but simple, frame-accurate handling. The codec interacts with resolution, frame rate, and scene motion to determine the final bandwidth and storage bill.
The pitfall is treating "codec" as a single setting rather than a compatibility contract. Every link in the chain — camera, network, VMS, recording, and especially the viewing clients — must support the chosen codec and ideally hardware-decode it. Choosing the most efficient codec saves disk but can overload clients that lack hardware decode. The deep codec trade-offs belong to the Video Encoding section; the VMS layer just has to honour them end to end.

