logo
Video Call
On this page

Video Encoding Format Selection

2024-01-02

Overview

ZEGO Express Web SDK uses WebRTC technology to implement real-time audio and video functionality, with video encoding supporting both H.264 and VP8 formats. This article introduces the advantages and disadvantages of both encoding formats, and helps developers better understand how to choose the appropriate encoding format based on their business scenarios.

Compatibility Notes

Before starting to use audio and video services, developers can use the compatibility detection interface checkSystemRequirements provided by ZEGO Express Web SDK to detect the browser environment and devices, and prompt for related risks.

Encoding Format Comparison

The comparison of the two encoding formats is as follows:

Encoding FormatAdvantagesDisadvantages
H.264Mature ecosystem, supports direct relaying to CDN and direct interoperability with mini-programs.Poorer support on mobile browsers, such as WeChat browser, WebView, etc.
VP8
  • Google-promoted, performs better than H.264 in Chrome browser, and fully open-source.
  • Better compatibility on mobile browsers, such as WeChat browser, WebView, etc.
Poor ecosystem support, cannot directly relay to CDN or directly interoperate with mini-programs.

Browser Compatibility

Desktop

SystemBrowserH.264VP8
Windows
  • Chrome
  • Edge
  • Firefox
✔️✔️
macOS
  • Chrome
  • Safari
  • Edge
  • Firefox
✔️✔️
ChromeOSChrome✔️✔️
  • Chrome

    • On all Windows devices using AMD chips and some using Intel chips, when Chrome uses H.264 encoding, the sending bitrate may not reach the set value. Developers are recommended to use VP8 encoding or try disabling hardware acceleration.
    • Chrome 84 on macOS has a defect. When using H.264 format for encoding, WebRTC may experience sudden frame rate drops, causing image stuttering. For details, please refer to the official Google explanation Issue 1088650 and Issue 12704. Developers are recommended to use VP8 format on Chrome 84 or above on macOS.
  • Safari

    Safari 12.1 or below only supports H.264 codec.

  • Firefox

    On Mac devices using Apple M1 chips, Firefox does not support H.264 codec. For details, see Firefox official explanation.


Mobile

Android

Android supports self-developed WebView or third-party WebView. Different devices and applications implement WebView differently, so ZEGO Express Web SDK's support for different application versions and device hardware also varies. Developers are recommended to perform compatibility detection before use.

BrowserFunctionH.264VP8
WebViewPublish/Play stream✔️✔️
Chrome BrowserPublish/Play stream✔️✔️

WebView includes WeChat built-in browser, Enterprise WeChat built-in browser, QQ built-in browser, DingTalk, Toutiao, etc. In these WebViews and Chrome browsers, the usage restrictions regarding browser versions, chip types, and encoding formats are as follows:

Restriction NameRestriction Description
Encoding FormatUsing H.264 encoding to send video streams may result in a lower bitrate for the sent video stream, unable to reach the expected bitrate.
ChipCannot use H.264 encoding to send video streams on devices equipped with MediaTek chips.
Browser Version and Chip
  • On Android Chrome below version 88, devices equipped with HiSilicon Kirin chips cannot use H.264 encoding to send video streams.
  • On Android Chrome below version 81, devices equipped with MediaTek or HiSilicon Kirin chips cannot use H.264 decoding to receive video streams. Since ZEGO Native SDK sends video streams in H.264 encoding by default, if there are stream publishers using ZEGO Native SDK in the room, Web SDK must use Chrome 81 or above to receive H.264 encoded streams on devices equipped with HiSilicon Kirin or MediaTek chips.

    iOS

    iOS only supports system WebView, so ZEGO Express Web SDK's support for WebView is only related to the iOS system version.

    BrowserFunctionH.264VP8
    WebView (WeChat built-in browser, etc.)Publish stream✔️ (iOS 14.3 or above)
    Play stream✔️ (iOS 12.1.4 or above)✔️ (iOS 12.2 or above)
    Safari BrowserPublish/Play stream✔️ (iOS 11 or above)✔️ (iOS 12.2 or above)

    When using H.264 encoding format to publish streams on iOS, 1080p or higher resolution video cannot be relayed to CDN.

    Based on the above compatibility notes and ZEGO market user data statistics, devices that do not support VP8 account for a relatively small proportion. VP8 is slightly better than H.264 in terms of browser compatibility. Therefore:

    • When the business scenario is primarily Web platform, developers are recommended to use VP8 encoding format.
    • If the developer's business scenario involves multiple platforms such as Web, iOS, Android, Windows, macOS, etc., and good multi-platform compatibility is desired, developers are recommended to use H.264 encoding format.

    Specific scenario recommendations are as follows:

    Host SideAudience SideRecommended Encoding FormatAdvantagesDisadvantagesApplication Scenarios
    WebRTCWebRTCVP8Best compatibility and quality.-Bank/Securities Account Opening
    CDNH.264No transcoding required.Some device models do not support H.264 encoding when the host publishes streams.Showroom Live Streaming
    VP8Better publisher compatibility.Requires manual transcoding.
    Mini ProgramH.264No transcoding required.Some device models do not support H.264 encoding when the host publishes streams.Bank/Securities Account Opening
    Warning
    • When playing streams on Web, there is no need to specify the encoding format. The SDK will automatically select the format based on the publishing encoding.
    • When Web selects VP8 encoding format and interoperates with Native UDP, Native needs to specify VP8 encoding format (supported by default build).

    Regardless of choosing H.264 or VP8, compatibility detection must first be performed on the browser being used. Developers can check browser compatibility through the checkSystemRequirements interface, which is also a prerequisite for the SDK to automatically select encoding.

    Note

    Transcoding refers to converting video signals from one format to another. ZEGO services support conversion of audio and video encoding formats, resolution, bitrate, etc. Developers can refer to the Stream Mixing Transcoding Example Demo. For questions, please contact ZEGOCLOUD Technical Support.

    Previous

    Integration Guide

    Next

    Multiplayer Video Call

    On this page

    Back to top