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.
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.
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?.
| Codec | Type | Where it shows up |
|---|---|---|
| H.264 (AVC) | Video | The default for RTMP live streaming; accepted almost everywhere |
| H.265 (HEVC) | Video | Smaller files at the same quality; support varies by network and device |
| AV1 | Video | Newer and efficient; heavy to encode without hardware support |
| VP8 / VP9 | Video | Common in browsers and WebRTC |
| AAC | Audio | The default sound codec for live streaming |
| Opus | Audio | Common in WebRTC and calls |
| MP3 | Audio | Older; 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.
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.
| Container | Typical use | Typical codecs |
|---|---|---|
| MP4 | Files for download, uploads to networks | H.264 or H.265 with AAC |
| MKV | Recording in OBS, safe if the computer crashes | Most codecs |
| WebM | Browsers | VP8, VP9 or AV1 with Opus |
| FLV | The wrapper RTMP uses inside the stream | H.264 with AAC |
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.
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.
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.
The method that compresses video or sound so it can be sent or stored, and decompresses it for playback.
H.264 for video and AAC for sound. Nearly every network accepts them, and StreamLive Pro's encoder ingest accepts only them.
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.
The codec compresses the video and sound. The container, such as MP4 or MKV, wraps them together with their timing.
No. The browser and our servers handle it, and the networks receive H.264 video and AAC sound.
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 streamingWhat 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 onceStream 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