Video encoding is the process of compressing raw video into a smaller digital format using a codec, so it can be stored, streamed or shared. An encoder analyses the frames, removes information that is redundant or hard for the eye to notice, and writes the result as a compressed bitstream, which a decoder later turns back into pictures for playback. Without encoding, a single minute of 1080p video would take up gigabytes.
This guide explains how encoding works in plain terms, the key terms you will meet (codec, container, bitrate, CRF, transcoding), and how to make sensible choices when you encode your own videos.
Why video needs encoding
Uncompressed video is enormous. A 1920x1080 frame in 8-bit 4:2:0 colour is about 3.1 MB. At 30 frames per second, that is roughly 93 MB every second, or over 5 GB per minute - before any audio. No phone, streaming service or broadband connection could cope with that at scale.
Modern codecs such as H.264 commonly deliver good-looking 1080p at somewhere around 5 to 10 Mbps, a reduction of roughly a hundred times or more. That is only possible because encoders are very good at finding and discarding information you will not miss.
How an encoder compresses video
Most modern codecs - H.264, H.265/HEVC, VP9 and AV1 - use the same broad techniques, refined over each generation.
1. Colour subsampling
Human eyes are more sensitive to brightness than to colour detail. Video is usually stored as YUV (brightness plus two colour-difference channels) rather than RGB, and the colour channels are stored at lower resolution. In 4:2:0, the format used by almost all consumer video, colour is stored at a quarter of the resolution of brightness. Professional formats often use 4:2:2 or 4:4:4 to keep more colour detail for editing and keying.
2. Intra-frame (spatial) compression
Each frame is split into blocks. The encoder predicts each block from neighbouring pixels, then converts the leftover difference into frequency components using a mathematical transform similar to the one in JPEG. Fine detail the eye barely notices is stored with less precision - a step called quantisation. This is where most of the actual information is thrown away, and it is why heavily compressed video looks blocky or smeared.
3. Inter-frame (temporal) compression
Consecutive frames are usually very similar. Instead of storing every frame in full, the encoder stores motion vectors that describe how blocks have moved from a previous (or future) frame, plus any small correction. This gives three main frame types:
- I-frames (keyframes): complete pictures that can be decoded on their own. Players need them to seek.
- P-frames: predicted from earlier frames.
- B-frames: predicted from both earlier and later frames, which usually makes them the smallest.
A sequence starting with one keyframe and running to the next is called a GOP (group of pictures). Longer GOPs compress better; shorter GOPs make seeking and editing easier.
4. Entropy coding
Finally, the resulting data is packed as efficiently as possible using lossless coding schemes (CABAC in H.264 and HEVC), which squeeze out the remaining statistical redundancy.
Key terms
| Term | What it means |
|---|---|
| Codec | The compression format (H.264, HEVC, AV1, ProRes) or the software that implements it. |
| Encoder | A specific implementation, such as x264, x265, SVT-AV1 or NVIDIA NVENC. One codec can have many encoders of differing quality and speed. |
| Container | The file format (MP4, MKV, MOV) that holds video, audio, subtitles and metadata together. |
| Bitrate | How much data is used per second, e.g. 8 Mbps. Higher usually means better quality and bigger files. |
| CRF / constant quality | A mode where the encoder targets a quality level and varies the bitrate to suit each scene. |
| Transcoding | Decoding an already-encoded video and encoding it again, usually to a different codec or bitrate. |
| Remuxing | Moving streams into a new container without re-encoding, so there is no quality loss. |
The codec and container are often confused; our guide to codec vs container explains the difference in detail.
Lossy and lossless encoding
Almost all delivery codecs are lossy: they permanently discard information. Each time you re-encode a lossy file, more is lost, which is why it is best to encode from the highest-quality source available. Lossless codecs such as FFV1 or HuffYUV reproduce every pixel exactly but produce much larger files, so they are mainly used for archiving and intermediate work. Between the two sit intermediate codecs such as ProRes and DNxHR, which are technically lossy but use high bitrates and simple compression so they hold up well in editing.
Software vs hardware encoding
Encoding can run on the CPU (software encoders such as x264 and x265) or on dedicated hardware in a graphics chip (NVIDIA NVENC, Intel Quick Sync, AMD's hardware encoders). Hardware encoders are much faster and use little CPU, which makes them ideal for streaming and quick exports. Software encoders are slower but, at slow presets, generally achieve better quality at a given file size.
Choosing encoding settings
For most people, a handful of decisions cover nearly everything:
- Codec: H.264 for maximum compatibility, H.265 or AV1 for smaller files on modern devices. See H.264 vs H.265.
- Rate control: constant quality (CRF) for files you keep; bitrate or two-pass when you need a predictable size or a streaming limit.
- Preset: slower presets compress more efficiently at the cost of time.
- Resolution and frame rate: keep the source values unless you have a reason to change them.
- Container: MP4 for broad compatibility, MKV for flexibility with multiple audio and subtitle tracks.
Here is a simple FFmpeg example that encodes a file to H.264 at constant quality, with AAC audio:
ffmpeg -i input.mov -c:v libx264 -crf 21 -preset slow -c:a aac -b:a 192k output.mp4
For practical step-by-step advice, see how to compress video without losing quality.
Doing it with Movie Encoder
Movie Encoder is a Windows 10/11 encoding app built on FFmpeg. It shows full media info for each source, including codec, resolution, frame rate, bit depth, chroma subsampling and bitrates, so you can see exactly how a file was encoded. It encodes H.264, H.265, AV1, VP9, ProRes, DNxHR, FFV1 and more, using the CPU or NVIDIA, Intel and AMD hardware encoders when your PC supports them.
Beginner, Standard and Expert modes let you start simple and reveal settings such as CRF, GOP length, B-frames and pixel format as you learn, and the command preview shows the exact FFmpeg arguments for every job.
Frequently asked questions
What is the difference between encoding and transcoding?
Encoding usually means compressing video from a raw or uncompressed source. Transcoding means decoding an already-compressed video and encoding it again, often to a different codec or bitrate.
Is encoding the same as converting?
Converting is a broader everyday term. It can mean re-encoding to a new codec or simply moving the streams into a different container without re-encoding.
Why does re-encoding a video make it look worse?
Lossy codecs discard information each time they encode, and the losses accumulate across generations. Always encode from the best available source.
