Перейти к содержимому

Урок 4 · How Video Works

Codecs, Containers and Bitrate

Learn the difference between a video codec and a container, what bitrate means, how to estimate file size, and why proxy files make editing smoother.

Raw video is enormous. To make files practical, cameras and apps compress them. Understanding a few words about compression will help you choose settings, fix playback problems and plan your storage.

The three words to know are codec, container and bitrate.

What you will learn

  • What a codec does and what a container does
  • How bitrate connects quality and file size
  • How to estimate file size
  • Why some files are hard to edit, and how proxies help

Codec versus container

A codec is a method for compressing and decompressing video or audio. The name comes from "coder" and "decoder".

A container is the file format that holds the compressed video, the audio and extra information together. The file extension usually shows the container.

Think of a container as a box and a codec as the way the items inside are packed.

Item Examples
Containers MP4, MOV, MKV, WebM
Video codecs H.264 (also called AVC), H.265 (HEVC), AV1, VP9, Apple ProRes, DNxHR
Audio codecs AAC, Opus, uncompressed PCM

Two files that both end in .mp4 can use different video codecs. That is why one MP4 may play on a device and another may not.

flowchart LR
  A["Video stream (a codec)"] --> C["Container file"]
  B["Audio stream (a codec)"] --> C
  D["Extra data: timing, captions"] --> C

A container holds separately compressed streams in one file.

Two kinds of compression

Many codecs save space by looking at changes between frames. Instead of storing every frame fully, they store a complete frame now and then, and describe the other frames using nearby ones. This is often called long-GOP or inter-frame compression. It makes small files, but your computer must do extra work to jump to a random frame.

Other codecs, or modes, compress each frame on its own. This is called intra-frame compression. Files are bigger, but scrubbing through them is usually easier. ProRes and DNxHR are common examples used for editing.

Compression is often lossy: it removes some information to save space. Each time you re-encode with a lossy codec, you may lose a little quality. For this reason, avoid exporting, importing and exporting again many times.

Bitrate

Bitrate is the amount of data used for each second of video, usually written in megabits per second (Mbps).

A higher bitrate usually allows better quality, especially with fast motion, grain, water or confetti. It also makes larger files. Quality depends on the codec too. A newer codec can often reach similar quality at a lower bitrate than an older one, though it may need more computing power.

Estimating file size

Be careful: there are 8 bits in 1 byte.

size in megabytes = bitrate in Mbps × seconds ÷ 8

Examples:

  • 8 Mbps for 60 seconds: 8 × 60 ÷ 8 = 60 MB.
  • 16 Mbps for 10 minutes (600 seconds): 16 × 600 ÷ 8 = 1200 MB, about 1.2 GB.
  • 100 Mbps for 20 minutes (1200 seconds): 100 × 1200 ÷ 8 = 15,000 MB, about 15 GB.

If audio has its own bitrate, add it to the video bitrate. These are estimates. Actual files can differ.

Constant and variable bitrate

With constant bitrate (CBR), the data rate stays about the same. With variable bitrate (VBR), the encoder can spend more data on complex moments and less on simple ones. Many export tools offer VBR as a good default. If a platform asks for a specific method, follow it.

Color depth and chroma in brief

You may see 8-bit or 10-bit. This is the number of steps available for each color channel. 8-bit has 256 steps and 10-bit has 1024. More steps can help when you adjust color strongly, because smooth skies are less likely to break into visible bands.

You may also see 4:2:2 or 4:2:0. These describe how much color detail is kept compared with brightness detail. 4:2:2 keeps more color information than 4:2:0. This can matter for green screen and heavy color work. You will return to color in the Color chapter.

When files are hard to edit

Playback may stutter even on a decent computer. Possible reasons include a demanding codec, high resolution, many effects or a slow drive. One helpful tool is a proxy.

A proxy is a smaller, easier-to-play copy of your footage. You edit with proxies. When you export, the program uses the original files (check that this is the setting in your tool). The editing decisions stay the same.

Another issue is variable frame rate. Some phones and screen recorders do not capture frames at a perfectly steady rate. This can cause audio to drift out of sync in some editors. If that happens, converting the clip to a constant frame rate before editing often helps.

When you receive files from many sources, make a short test: import one clip from each source and play a long section. It is much easier to fix problems before you start cutting.

Common mistakes

  • Believing that renaming a file from .mov to .mp4 converts it. Renaming does not re-encode the video.
  • Confusing Mbps (megabits) with MB/s (megabytes). They differ by a factor of 8.
  • Using a very low bitrate for fast-moving scenes and getting blocky pictures.
  • Re-exporting the same lossy file many times.

Try it

File size estimator

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. Which one is a container?

    MP4 is a container. H.264 is a video codec and AAC is an audio codec.
  2. 2. About how big is 60 seconds of video at 24 Mbps, ignoring audio?

    24 times 60 divided by 8 equals 180 megabytes.
  3. 3. What is a proxy file?

    You edit with the proxy and export from the originals.
  4. 4. Two MP4 files behave differently on one device. What is a likely reason?

    The container does not tell you which codec is inside.

Summary

  • A codec compresses data. A container holds the streams in a file.
  • Bitrate is data per second. Size in MB is Mbps × seconds ÷ 8.
  • Inter-frame codecs save space. Intra-frame codecs are often easier to edit.
  • Proxies make heavy footage easier to work with.
  • Variable frame rate files can cause sync problems.

Next: The Editing Workflow

Отслеживайте прогресс

Создайте бесплатный аккаунт, чтобы отмечать пройденные уроки и продолжать с того места, где остановились, на любом устройстве.