Video encoding: how to compress videos for every screen

What video encoding is, which codecs and settings matter, and how to prepare your files for streaming so your videos play smoothly on every phone, laptop and TV

On this page

Video encoding is the process of compressing raw video with a codec, so the file becomes small enough to store and stream while still looking good. For streaming, a video is usually encoded into several versions at different qualities, so every viewer gets the version that suits their screen and connection. Without encoding, online video simply wouldn’t work. In this article you’ll learn how encoding works, which codecs matter, which settings to watch and how to prepare your files for a streaming platform.

What is video encoding?

A video straight from a camera or editing program is enormous. Encoding uses a codec (short for coder-decoder) to remove information the eye barely notices and to store only what changes between frames. The result is a much smaller file that a player can decode and play smoothly.

Two terms are often mixed up:

  • Codec: the compression method, such as H.264, HEVC or AV1.
  • Container: the file format that holds the video, audio and subtitles together, such as MP4 or MOV. An MP4 file usually contains H.264 video and AAC audio.

When an already encoded file is converted again, for example by a streaming platform after upload, this is called transcoding.

Why encoding matters

It makes streaming possible

Uncompressed HD video needs far more bandwidth than a normal internet connection can deliver. Encoding brings that down to a few megabits per second, for on-demand video and livestreams alike.

It makes video work on every device

Phones, laptops, smart TVs and streaming devices don’t all support the same formats. Encoding into widely supported codecs ensures your video plays everywhere, including on older devices.

It enables adaptive streaming

Streaming platforms encode each video into a set of versions at different resolutions and bitrates, often called a bitrate ladder. The video is cut into short segments and delivered via protocols such as HLS or MPEG-DASH. The player constantly checks the connection and switches between versions, so the video keeps playing instead of buffering.

The most important codecs

  • H.264 (AVC): the most compatible codec. It plays on virtually every browser, phone and TV, which is why it is still the standard for delivery.
  • H.265 (HEVC): roughly the same quality at a lower bitrate, popular for 4K, but browser support is uneven and licensing is complex.
  • VP9: Google’s royalty-free codec, widely used on YouTube.
  • AV1: a newer royalty-free codec with very efficient compression. Hardware support is growing, but not every device can play it yet.
  • AAC: the usual audio codec for streaming video.

Settings that determine quality and size

  • Resolution: 1920×1080 for HD, 3840×2160 for 4K.
  • Bitrate: how much data is used per second. Higher means better quality and bigger files, but beyond a certain point you mainly add size.
  • Frame rate: such as 25 or 30 frames per second. Use a constant frame rate for streaming.
  • Colour and bit depth: 8-bit with Rec.709 is the safest choice for wide compatibility. HDR and 10-bit video don’t play everywhere.
  • Audio: stereo AAC works on every device. Surround sound is not supported by all devices.

Encoding videos yourself

You don’t need expensive software. HandBrake is a free program with ready-made presets, Shutter Encoder is a free all-round converter, and FFmpeg is the command-line tool that powers many video services. See our 10 FFmpeg commands for video editing and our tips on how to make a video file smaller.

One important tip: if you upload to a streaming platform, don’t compress your video as much as possible first. The platform encodes it again for every screen, so you get the best result by uploading a high-quality master file. Compressing twice costs quality.

Preparing your files for AudiencePlayer

On AudiencePlayer you upload one high-quality file, and the platform automatically encodes it into multiple versions for adaptive streaming up to 4K. Encoding takes roughly as long as the video itself, so a one-hour film needs about an hour. The file upload specifications in the help centre list everything; these are the key points:

  • Container: MP4 is preferred, MOV and MKV are also accepted. The file should contain one video track and one or more audio tracks, and nothing else: extra data tracks, such as the timecode track some professional export presets add, can make processing fail.
  • Video: H.264, 8-bit, Rec.709 colour and square pixels. HDR and 10-bit video are not supported. A 10-bit file may look fine on a Mac but fail in Firefox or on iPhone.
  • Resolution and bitrate: 1920×1080 at a minimum of 6,000 kbps for HD, or 3840×2160 at a minimum of 20,000 kbps for 4K.
  • Frame rate: a constant 25 fps. Video is converted to 25 fps for compatibility with older devices, TVs and Chromecast.
  • Audio: AAC at 48 kHz, stereo at 128 kbps. Always include a stereo track; discuss surround sound with the team before uploading.
  • File names: short and unique, without spaces or extra dots. Re-uploading a file? Give it a new name, such as “film-v2.mp4”. Keep single files under 25 GB.

Bigger is not always better: extremely high bitrates mostly lead to longer uploads and a higher chance of timeouts, not to visibly better quality.

Let the platform handle encoding

Encoding, storage and delivery are part of every video on demand platform on AudiencePlayer, so you can focus on your content. Want to see how it works with your own videos? Request a demo.

Frequently Asked Questions

What is the difference between video encoding and compression?

Compression is the goal, encoding is how you get there. Encoding converts video with a codec such as H.264, which compresses it into a much smaller file that still plays smoothly.

Which codec should I use for streaming?

H.264 in an MP4 container is still the safest choice, because it plays on virtually every device. HEVC and AV1 are more efficient but not supported everywhere, so platforms often use them alongside H.264 rather than instead of it.

Does encoding reduce video quality?

All common codecs remove some information, but at a sensible bitrate the difference is hard to see. Quality suffers mainly when you compress too much or encode a video several times in a row.

What settings should I use before uploading to AudiencePlayer?

An MP4 with H.264 video in 8-bit Rec.709, 1920×1080 at a minimum of 6,000 kbps (or 3840×2160 at 20,000 kbps for 4K), a constant 25 fps and stereo AAC audio. The file upload specifications in the help centre list all requirements.

Why does my video play on my Mac but not on an iPhone or in Firefox?

Usually the source file is 10-bit or HDR, which many browsers and devices can’t play. Export it again as 8-bit H.264 with Rec.709 colour and upload it under a new file name.

BOOK A DEMO

Ready to start your own video platform?

See a live platform demo — 30 minutes, no obligations.