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:
av1
(AV1): Next-generation codec with high compression efficiency. Best for modern web use, but may have limited hardware support.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.
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 the three codecs: AV1, H.264, and H.265.
We’re using the canPlayType()
method in Javascript. Using canPlayType()
returns one of three possible values:
probably
: The browser is highly confident it can play this format (full support)maybe
: The browser thinks it might be able to play this format, but isn’t certain (partial support)" "
(empty string): The browser cannot play this format (no support) It shows how each codec affects the video quality and file size. It also will analyze your browser’s support for each codec.
This is directly testing support in the user’s current browser based on what the browser itself reports. It’s important to note that:
- This is real-time detection happening in the user’s actual browser
- The results might vary depending on the browser (Chrome, Firefox, Safari, etc.) and device
- A result of “maybe” doesn’t guarantee playback will work perfectly
- Even with “probably”, hardware acceleration and performance may differ
Testing codec support and fetching file sizes...