StreamLive Pro

What is a video codec? H.264, AAC and live streaming

What is a codec: the method that compresses video and sound. Why live streams use H.264 and AAC, how H.265 and AV1 differ, and codec vs container.

Updated · 5 min read

A codec is the method an encoder uses to compress video or sound, and a player uses to decompress it. The word joins coder and decoder. Uncompressed video is enormous, so a codec throws away what the eye or ear will not miss and describes the rest in as few bits as it can. For live streaming the standard pair is H.264 for video and AAC for sound: almost every encoder can produce them, and almost every network and player can take them.

Shorter definitions of related terms are in the Live streaming glossary: the terms you will meet.

How a video codec saves space

Most of what changes from one frame to the next is small: a mouth moves, a hand turns a page, the wall behind stays the same. A video codec takes advantage of that.

When the bitrate is too low for the amount of change, the codec has to throw away more, and you see blocks in fast motion. A new viewer or a player that lost data has to wait for the next keyframe to get a clean picture, which is why networks ask for a keyframe every few seconds: What is a keyframe interval, and why set it to 2?.

Codecs you meet in live streaming

CodecTypeWhere it shows up
H.264 (AVC)VideoThe default for RTMP live streaming; accepted almost everywhere
H.265 (HEVC)VideoSmaller files at the same quality; support varies by network and device
AV1VideoNewer and efficient; heavy to encode without hardware support
VP8 / VP9VideoCommon in browsers and WebRTC
AACAudioThe default sound codec for live streaming
OpusAudioCommon in WebRTC and calls
MP3AudioOlder; still accepted by some ingest servers

YouTube's encoder settings page, for example, lists H.264, H.265 (HEVC) and AV1 for video, and AAC or MP3 for audio (YouTube Help: live encoder settings, checked 5 November 2026). Other networks accept less. That is the reason H.264 and AAC are the safe pair when one stream goes to several networks.

Codec is not container

A container is the file or stream wrapper that holds the compressed video, the compressed sound and the timing between them. MP4, MKV, MOV, WebM and FLV are containers. The same H.264 video can sit in an MP4 file or travel inside an RTMP stream. So "MP4" tells you the wrapper, not the codec inside. When a file will not play, the cause is usually a codec the player lacks, not the container.

ContainerTypical useTypical codecs
MP4Files for download, uploads to networksH.264 or H.265 with AAC
MKVRecording in OBS, safe if the computer crashesMost codecs
WebMBrowsersVP8, VP9 or AV1 with Opus
FLVThe wrapper RTMP uses inside the streamH.264 with AAC

What StreamLive Pro accepts and sends

From an encoder. StreamLive Pro receives encoder streams through Cloudflare Stream. Cloudflare's page says its live input supports only H.264 video and AAC audio, and for AAC, ADTS is supported but LATM is not (Cloudflare Stream: Start a live stream, checked 5 November 2026). Set OBS, vMix, an ATEM or FFmpeg to H.264 and AAC. A stream in H.265 or AV1 may connect and still show no usable picture: My encoder says it is streaming, but there is no picture. Over WHIP, which is in beta, Cloudflare lists other codecs: What is WHIP? WebRTC ingest for live streaming.

From the browser studio. The browser compresses the program with its own video encoder, preferably H.264. When the browser delivers H.264, our server passes the picture on as it is; otherwise it encodes it to H.264 on the server. The sound is sent on as AAC stereo at 48 kHz. You do not choose a codec in the browser studio.

To the networks. Our servers send the same H.264 and AAC stream to every destination you tick, over RTMP, RTMPS or SRT.

In files. Exports from the video editor are MP4 today. Caption files such as SRT and VTT are text, not video codecs: Export captions as SRT, VTT or ASS, and which one to use.

Hardware support for codecs

Encoding H.264 is light for modern computers, especially with the graphics chip's built-in encoder. H.265 and AV1 save bitrate but take far more work to encode in software, and only newer graphics chips encode them in hardware. For a live that has to reach several networks, the bitrate saved by a newer codec rarely helps, because the receiving side may not accept it.

How to check which codec your stream uses

If one of them says HEVC, H.265 or AV1 and you send to StreamLive Pro over RTMP or SRT, switch it to H.264 before the live.

Common mistakes

Frequently asked questions

What is a codec in simple words?

The method that compresses video or sound so it can be sent or stored, and decompresses it for playback.

Which codec should I use for live streaming?

H.264 for video and AAC for sound. Nearly every network accepts them, and StreamLive Pro's encoder ingest accepts only them.

Is H.265 better than H.264 for streaming?

It needs less bitrate for the same picture, but fewer networks and devices accept it as a live input. For several networks at once, H.264 is the safe choice.

What is the difference between a codec and a container?

The codec compresses the video and sound. The container, such as MP4 or MKV, wraps them together with their timing.

Do I choose a codec in the StreamLive Pro browser studio?

No. The browser and our servers handle it, and the networks receive H.264 video and AAC sound.

Keep reading

SRT file or SRT protocol? Two different things

SRT means two things: a subtitle file (SubRip, .srt) and a live streaming protocol (Secure Reliable Transport). How to tell which one you need and where each is used.

What is WHIP? WebRTC ingest for live streaming

What is WHIP: a standard way to send a live stream over WebRTC with one HTTP request. How it differs from RTMP and SRT, its limits, and where it stands in StreamLive Pro.

How to stream a game to Twitch, Kick and YouTube at once

Stream a game to Twitch, Kick and YouTube at once: OBS sends one stream, StreamLive Pro sends it on, plus chat, upload, platform rules and Shorts of your best moments.

What is an ingest server in live streaming?

What is an ingest server: the address your encoder sends a live stream to, with a stream key. How ingest differs from playback, what it checks, and where to find yours.

Want to try it? 7-day trial, no credit card.

Start free
Mobile app Home Help Center Guides PrivacyTermsAccessibility