isVideoEncoderSupported method

Future<int> isVideoEncoderSupported(
  1. ZegoVideoCodecID codecID,
  2. {ZegoVideoCodecBackend? codecBackend}
)

Whether the specified video encoding type and implementation are supported.

Available since: 3.0.0 and above Description: Whether the specified video encoding is supported depends on the following aspects, whether the hardware model supports hard encoding, whether the performance of the hardware model supports soft encoding, and whether the SDK has the encoding module. When to call: After creating the engine. Caution: It is recommended that users call this interface to obtain H.265 encoding support capability before publish stream with H.265 encoding, if not supported, you can use other encodings for publish, such as H.264.On the mobile platform, the SDK only supports H.265 hardware encoding, and it is affected by the model and hardware capabilities. You need to call the enableHardwareEncoder function to enable hardware encoding, and then use this function to determine whether H.265 hardware encoding is supported.

  • codecID Video codec id. Required: Yes.
  • codecBackend Backend implementation of encoder. Required: Yes.
  • Returns Whether the specified video encoding format is supported; 0 means not supported, and the encoding format cannot be used for publish stream; 1 means support, you can use this encoding format for publish stream; 2 means not confirmed, it is recommended to call this interface later.

Implementation

Future<int> isVideoEncoderSupported(ZegoVideoCodecID codecID,
    {ZegoVideoCodecBackend? codecBackend}) async {
  return await ZegoExpressImpl.instance
      .isVideoEncoderSupported(codecID, codecBackend: codecBackend);
}