# Terminology

Canonical URL: https://encode.wiki/start-here/terminology/
Content version: ca42e61ede0a24f789d7287a0001244ad22f4abf
Status: current
License: CC BY-SA 4.0
Checksum (SHA-256): cb1ab43d28e93d10c7907b8a763deee25e0726e631dcaff4528a2bbcf670d650

Most encoding vocabulary describes simple ideas. These are the terms you will meet most often on this wiki and in tool documentation.

## Files, streams and containers

### Codec, encoder and decoder
A **codec** is a compression format such as H.264, AV1 or Opus, defined by a specification. An **encoder** is a program that produces that format (x264, SVT-AV1, libopus); a **decoder** reads it back (dav1d decodes AV1). One codec can have many encoders of very different quality. See the [prologue](/start-here/encoding-basics/#what-is-a-codec).

### Bitstream and elementary stream
A **bitstream** is the compressed data an encoder produces, following the codec's syntax. An **elementary stream** is one such stream on its own: a single video, audio or subtitle track, before it is put into a container.

### Container
A **container** (MKV, MP4, WebM, MOV) is a file format that holds one or more elementary streams together with timing, chapters, metadata and attachments. The container decides which codecs and how many tracks a file can hold, and some of the compatibility of the result. See [containers](/containers/).

### Muxing, demuxing and remuxing
**Muxing** packs elementary streams into a container; **demuxing** extracts them. **Remuxing** moves streams to a different container without re-encoding, so it is fast and lossless (`ffmpeg -i in.mkv -c copy out.mp4`).

### Transcoding
**Transcoding** decodes a stream and encodes it again, usually into a different codec or at a different quality. Transcoding from one lossy format to another always loses some quality, even at high settings. It has nothing to do with the container.

### Filter
A **filter** processes decoded frames or audio samples: scaling, cropping, denoising, deinterlacing, sharpening, tone mapping and so on. Filtering requires re-encoding.

### Bitstream filter
A **bitstream filter** modifies compressed data without decoding it. Examples are converting H.264 from MP4-style to Annex B start codes for MPEG-TS (`h264_mp4toannexb`) or rewriting color metadata in an HEVC stream header (`hevc_metadata`).

## Common containers

### MP4 / M4V
The most widely supported container: phones, browsers, TVs and editing software all handle it. Common contents are H.264, HEVC or AV1 video with AAC audio. AV1, VP9, Opus and FLAC all have official MP4 mappings, although older players may not support them. Subtitle support is limited to timed-text formats such as `mov_text` (tx3g); ASS and bitmap subtitles cannot be stored. FFmpeg and [MP4Box](/tools/utilities/mp4box/) both write MP4; `.m4v` and `.m4a` are the same format with different extensions.

### MOV
Apple's QuickTime format, which MP4 is based on. It is the usual container for [ProRes](/codecs/video/prores/) and other editing formats.

### MKV (Matroska)
Holds practically any codec, any number of video, audio and subtitle tracks, chapters and attachments such as fonts. It is the most flexible container and the usual choice for personal libraries and for intermediate work. Some devices and browsers do not play it. See [Matroska](/containers/matroska/).

### WebM
A restricted subset of Matroska for the web: VP8, VP9 or AV1 video, Vorbis or Opus audio, and WebVTT subtitles. Browsers do not display WebVTT tracks stored inside a WebM file; put subtitles in a separate `.vtt` file loaded with the `<track>` element instead ([MDN](https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Audio_and_video_delivery/Adding_captions_and_subtitles_to_HTML5_video)).

## Encoding controls

### Rate control, CRF and bitrate
**Rate control** decides how many bits each frame gets. **CRF** (constant rate factor) and similar constant-quality modes target a quality level and let the size vary; **bitrate** modes target a size or data rate and let quality vary. See [quality controls](/guides/quality-controls/).

### Preset
A **preset** bundles many encoder settings into one speed level. Slower presets search harder for efficient ways to code each frame, giving smaller files at the same quality.

### Keyframe and GOP
A **keyframe** (intra frame) can be decoded on its own; other frames are predicted from frames around them. A **GOP** (group of pictures) is the run of frames from one keyframe to the next. Players can only start decoding at a keyframe, so the GOP length trades seeking speed against compression.

### RDO
**Rate–distortion optimization** is how an encoder chooses between coding options: it weighs the bits each option costs against the distortion it causes. What counts as "distortion" matters a great deal: a simple squared-error measure favors blur, which is why good encoders add [psychovisual](/start-here/psychovisual/) terms.

## Picture properties

### Bit depth
The number of bits per sample: 8-bit gives 256 levels per channel, 10-bit gives 1,024. More levels mean smoother gradients and less banding. 10-bit is standard for HDR and often used for SDR AV1 and HEVC encodes as well.

### Chroma subsampling
Video is usually stored as brightness (luma, Y) plus two color-difference channels (chroma, Cb and Cr). Because eyes resolve color detail less sharply than brightness detail, chroma is often stored at lower resolution: **4:2:0** halves it in both directions (the norm for delivery), **4:2:2** halves it horizontally (common in production), and **4:4:4** keeps it at full resolution. Fine colored text and sharp red edges show the loss first.

## Perception and quality

### Perceptual, psychovisual and psychoacoustic quality
**Perceptual quality** is quality as people experience it: **psychovisual** for images and video, **psychoacoustic** for sound. Encoders that model perception spend bits where viewers and listeners notice errors. No metric fully captures it: metrics help narrow down settings and find bad scenes, but the final check is watching or listening. See [psychovisual quality](/start-here/psychovisual/) and the [quality comparison guide](/guides/compare-encoding-quality/).

### Discrete Cosine Transform (DCT)
The **DCT** converts a block of samples (pixels, or audio samples over time) into a set of frequency coefficients. For natural images and sound, most of the energy ends up in a few low-frequency coefficients, so the rest can be quantized coarsely or dropped with little visible or audible effect. The DCT is the core of JPEG; H.264, HEVC and AV1 use integer approximations of it alongside other transforms, and the related MDCT is used by AAC, Vorbis and Opus's CELT layer.
