Video Codec

video-codec

The parameter for video-codec specifies the video codec for encoding. This parameter will only work with fm=mp4 is set.

The parameter accepts the following as values:

  • h264 (H.264) (default): The most widely supported codec across devices and browsers. A good balance between quality and compatibility.
  • h265 (H.265): Improved compression over H.264 but with less universal browser support.
  • av1 (AV1): Next-generation codec with high compression efficiency. Best for modern web use, but may have limited hardware support.

Video codecs compress and decompress digital video files. Choosing the right codec affects the quality, file size, and compatibility with different devices and browsers.

Video Codec Comparison

The demo below compares file sizes across the three codecs: AV1, H.264, and H.265. Each codec is automatically set to different bitrates that produce similar visual quality, allowing you to see the file size differences between codecs. H.264 is used as the baseline for comparison since it’s the most widely supported codec across all browsers.

Select different codecs from the dropdown menus to compare their file sizes and visual output.

Testing codec support and fetching file sizes...

Video Codec Browser Support

Browsers and devices support each video codecs in varying degrees. Because of this, it’s important to check browser support when choosing a codec for your videos.

You can learn more about best practices for detecting and serving video codecs in our Creating a User-Friendly Video Player tutorial.

You can also see your own device and browser’s support for each codec by seeing the demo below:

Testing codec support...