Codec

A codec is software or hardware that compresses video or audio into a smaller file for storage or sending, then decompresses it for playback. The name joins the words coder and decoder. Common video codecs include H.264, HEVC and AV1, while AAC and Opus are common audio codecs. The choice of codec affects file size, picture quality and which devices can play the content.

Why it matters

The codec you choose decides how much you pay to store and stream every minute of video, and which viewers can watch it at all. A newer codec can cut delivery bills, but a codec a device cannot decode means a blank screen and a lost viewer. Blank screens from a codec mismatch show up in FastPix Video Data as startup failures and errors by device model and OS, before they show up as lost viewers.

How it works

  1. An encoder analyzes each frame and finds detail that repeats or that viewers will not notice.
  2. It removes or simplifies that detail and stores the rest as compact compressed data.
  3. The compressed video and audio are packed into a container file such as MP4, or into HLS segments.
  4. On playback, the device's decoder (software or a hardware chip) rebuilds the frames and sound for the screen.

What is the difference between a codec and a container?

A codec compresses the video or audio, while a container is the file wrapper that holds the compressed streams together. For example, an MP4 file is a container that might hold H.264 video and AAC audio. The same codec can sit in different containers, and one container can hold several codecs. Players need to support both the container and the codecs inside it.

Which video codec should I use for streaming?

H.264 is the safest choice for streaming because almost every device can play it. Add HEVC or AV1 renditions when you want smaller files for 4K, big TV screens or heavy traffic, and keep H.264 as the fallback. The right mix depends on where your viewers watch and how much bandwidth you serve.

CodecStrengthWatch out for
H.264Plays almost everywhereLarger files
HEVCSmaller files, common for 4K and HDRPatchy browser support, licensing
AV1Smaller files, royalty-freeSlow to encode, older devices lack hardware

Is a codec software or hardware?

A codec can be either. Software codecs run on a computer's main processor and are flexible but use more power. Hardware codecs are dedicated chips in phones, TVs and graphics cards that encode or decode much more efficiently. Most phones play H.264 and HEVC with hardware chips, which saves battery during long viewing sessions.

Where it's used

Video platforms, OTT services and short video apps choose codecs to balance storage and delivery costs against how many viewers' devices can play each file.

Where it usually goes wrong, and how FastPix handles it

Uploads arrive in many codecs and formats from phones, cameras and editing tools, and not every format plays on every viewer's device without conversion first.

Uploaded or imported files reach FastPix's On-Demand API over free, accelerated, edge-routed uploads, and are encoded and delivered as HLS. A signed webhook, video.media.ready, tells your app when the media is ready to play. Shipping video features no longer starts with building an encoding pipeline.

By the numbers

Watch: How Video Streaming Works | Video Engineering 101