A codec compresses and decodes audio or video. Newer codecs can often represent content more efficiently, but device support and encoding costs vary. A codec must work at both ends: the encoder must create it, and the recipient’s playback environment must decode it.
H.264
H.264 is widely supported and commonly used in MP4 files. Its broad compatibility can make it a practical delivery choice, although browser recording support may not expose it.
VP9 and AV1
VP9 and AV1 may offer improved compression in supported workflows. Their availability and performance depend on browsers, devices and software encoders; encoding can require more resources.
Verify rather than assume
The MediaRecorder API lets a browser report whether it supports recording a MIME type. That is a capability signal, not a guarantee that a particular encode will finish successfully.
A practical checklist
- List destination devices and players.
- Choose a codec the full audience can decode.
- Run a short export on representative hardware.
- Compare size and visible quality before committing to a full encode.
Common mistakes to avoid
- Choosing a codec solely because its name sounds newer.
- Ignoring encode time and battery use on older devices.
- Assuming one browser’s support applies to every browser.
Questions people ask
Is AV1 always smaller than H.264?
No universal result is guaranteed. Efficiency depends on content, settings and encoder implementation.
Can browsers record H.264?
Support depends on browser and platform. Check MediaRecorder.isTypeSupported and test an actual short recording.