Skip to main content
VIDEO · COMPRESSION AND ENCODING

What Is a Codec?

A codec (coder-decoder) is a method, in software or hardware, for compressing audio or video so it takes less space and bandwidth, then decompressing it for playback or analysis. Common video codecs are H.264, H.265, AV1 and MJPEG. The encoder compresses at the source and a matching decoder restores the picture at the other end.

01

How a codec works

A codec, short for coder-decoder, is a method for compressing digital audio or video and then decompressing it again. The encoder side shrinks the data so it is cheaper to store and send. The decoder side rebuilds it for display, playback or analysis. The word can mean the standard itself, such as H.264, or a piece of software or hardware that implements it.

Compression matters because raw video is enormous. Uncompressed 1080p at 60 frames per second runs to roughly 3 Gb/s, which is why it needs SDI or HDMI cables rather than a network. An H.264 encoder can carry a similar picture in well under 10 Mb/s, a reduction of several hundred times.

Most video codecs are lossy: they throw away detail the eye is unlikely to miss, so the decoded picture is close to, but not identical to, the original. Lossless codecs keep every bit and compress far less, so they are kept for archiving and medical or scientific images.

02

How video encoding works

Video encoding is the process of turning raw frames into a compressed stream. Modern codecs use the same broad steps:

  • //
    Prediction within a frame. Each block of pixels is predicted from its neighbours, and only the difference is kept. These intra-coded frames, called I-frames, can be decoded on their own.
  • //
    Prediction between frames. Most of a scene barely changes from frame to frame, so P-frames and B-frames store motion vectors and differences against other frames instead of the whole picture.
  • //
    Transform and quantisation. The remaining differences are converted to frequency values and rounded. This is where detail is discarded and where the bitrate is controlled.
  • //
    Entropy coding. The result is packed as tightly as possible, using techniques such as CABAC in H.264 and H.265.
03

Common video codecs compared

Each codec generation trades more processing for a lower bitrate at the same quality. The figures below are typical, and real results depend on the content, resolution and encoder settings.

Codec Standard body Published Bitrate for similar quality Typical use
MJPEG ISO/IEC JPEG, applied frame by frame 1990s Highest: each frame compressed alone USB cameras, low-latency links
H.264 (AVC) ITU-T and ISO/IEC MPEG 2003 Baseline for comparison Almost everything: streaming, CCTV, video calls
H.265 (HEVC) ITU-T and ISO/IEC MPEG 2013 Up to about half of H.264 4K streaming, IP cameras, broadcast contribution
VP9 Google 2013 Similar to H.265 Web video, YouTube
AV1 Alliance for Open Media 2018 Typically below H.265 Royalty-free web streaming
H.266 (VVC) ITU-T and ISO/IEC MPEG 2020 Up to about half of H.265 Early adoption in broadcast and 8K

H.264 remains the safe default because almost every device can decode it. H.265 suits 4K and multi-camera systems where bandwidth or storage is tight. AV1 is growing in web streaming because it is royalty-free, and H.266 is still early, with limited hardware support.

FAQ · 01
Should I use H.264 or H.265?
Use H.265 where bandwidth or storage is tight, such as 4K or many cameras, and every decoder in the chain supports it. Use H.264 where compatibility matters most. H.265 can deliver similar quality at up to about half the bitrate.
Read the full FAQ —
04

Hardware vs software encoding

Software encoders run on the processor and give the most control over quality, but they use a lot of CPU, especially at 4K. Hardware encoders are dedicated circuits in GPUs, processors and capture devices, such as Intel Quick Sync Video and NVIDIA NVENC. They encode several streams in real time at low power, which is what multi-camera and edge AI systems need.

Hardware support varies by chip, so it is worth checking before choosing a computer. For example, NVIDIA’s Jetson Orin Nano has no hardware video encoder, while other Jetson Orin modules do. Many capture cards, which bring video into a computer, pass raw frames to the host, but some encode on the card. Our range of M.2 video capture cards includes an HDMI card with 1080p30 hardware encoding, which takes that load off a small computer.

05

Codecs in industrial and AV systems

In streaming and AV-over-IP, the codec sets latency as well as bandwidth. Our hardware video encoders and decoders compress HDMI and SDI sources to H.264 or H.265 for IPTV, recording and remote viewing, while NDI encoders use NDI’s own low-latency compression, or H.264 and H.265 in the NDI HX versions, for live production networks.

For AI analysis, video usually has to be decoded back to raw frames before a model can use it, so decode capacity matters as much as encode. Feeding a model from a capture card avoids that round trip and keeps the full picture quality.

Latency is the other trade-off. Long groups of pictures and B-frames improve compression but add delay, so remote control, robotics and live monitoring links use low-latency settings, intra-only codecs such as MJPEG, or uncompressed video over SDI. Recording and distribution can accept more delay in exchange for smaller files.

06

Quick answers on codecs

Codecs: common questions

What does codec stand for?

Coder-decoder, or compressor-decompressor. Both expansions are used. Either way, it is the method that turns raw audio or video into a compact stream and back again.

What is a video codec?

The compression method used for moving pictures. H.264, H.265, AV1 and MJPEG are video codecs. Each defines how frames are predicted, transformed and coded, so any compliant decoder can play the result.

Is MP4 a codec?

No, it is a container. MP4, MKV, MOV and MPEG-TS are file or stream wrappers that hold video, audio and subtitle tracks. The video inside an MP4 is usually H.264 or H.265.

What is an audio codec?

The same idea for sound. AAC, Opus and MP3 are lossy audio codecs, FLAC is lossless, and G.711 is still common in telephony and intercom systems.

Why will a video not play on some devices?

The device lacks the right decoder. Playback needs a decoder for the exact codec and profile used. Newer codecs such as H.266 and some AV1 profiles still have patchy hardware support.

We fit capture cards and set up hardware encoding in industrial and edge AI computers as standard, matching the codec, resolution and number of streams to each system before it ships.