logo
On this page

Common Video Configuration

2026-03-05

Feature Overview

During video calls or live streaming, developers can specify video-related configurations for stream publishing and playing as needed, such as video capture resolution, video encoding output resolution, video frame rate, bitrate, view mode, and mirror mode.

  • Resolution:
    • Video resolution: A parameter used to measure the amount of data in an image, usually expressed as ppi.
    • Capture resolution: The screen resolution provided by capture devices such as cameras.
    • Encoding resolution: The resolution of the screen after encoding processing.
  • Bitrate: The number of bits transmitted per second, in bps (bit per second).
  • Frame rate: A measure of the number of video frames displayed per unit time, measured in "frames per second" (fps).

Setting appropriate video resolution, frame rate, and bitrate can provide users with a better experience in audio/video scenarios. Choosing the appropriate mirror mode and view mode allows developers to provide personalized video display modes.

Demo Source Code Download

Please refer to Download Demo Source Code to obtain the source code.

For related source code, please check the files in the assets/topics/publish_stream/ directory.

Prerequisites

Before setting video configurations, please ensure:

Usage Steps

1 Modify video configuration

Call the setVideoConfig interface to modify video configurations. Users can customize parameters or use preset values for settings.

Warning

You need to set the relevant video configurations before stream publishing (startPublishingStream) or preview (startPreview). After publishing streams, only encoding resolution and bitrate modifications are supported.

Custom parameter settings

Call the setVideoConfig interface to modify stream publishing video configurations. Through this interface, you can set video frame rate, bitrate, video capture resolution, and video encoding output resolution. If no special settings are made, the SDK will automatically apply the resolution, bitrate, and frame rate suitable for the selected scenario based on the selected scenario to obtain the best experience effect. For details, please refer to Scenario-based Audio/Video Configuration.

Note

If the playing end needs to pull 60-frame streams, please contact technical support. For details, please refer to Does ZEGO Express SDK support pulling 60-frame streams?

Taking setting the video capture resolution to 360p, encoding resolution to 360p, bitrate to 600 kbps, and frame rate to 15 fps as an example:

let videoConfig = new ZegoVideoConfig()
videoConfig.captureWidth = 640
videoConfig.captureHeight = 360
videoConfig.encodeWidth = 640
videoConfig.encodeHeight = 360
videoConfig.bitrate = 600
videoConfig.fps = 15

// Set video configuration
this.engine.setVideoConfig(videoConfig)

Use preset value settings

In addition to custom parameter settings, you can also use the preset combination values provided by ZEGO Express SDK. The preset combination values of ZegoVideoConfigPreset are as follows:

ZegoVideoConfigPresetCapture Resolution
(Width × Height)
Encoding Resolution
(Width × Height)
Frame Rate(fps)Bitrate(kbps)
Preset180P320 × 180320 × 18015300
Preset270P480 × 270480 × 27015400
Preset360P640 × 360640 × 36015600
Preset540P960 × 540960 × 540151200
Preset720P1280 × 7201280 × 720151500
Preset1080P1920 × 10801920 × 1080153000

Example code for calling the setVideoConfig interface using preset values:

// Use presets for video settings
let videoConfig = new ZegoVideoConfig(ZegoVideoConfigPreset.Preset1080P)
this.engine.setVideoConfig(videoConfig)

Previous

Scenario-based AI Noise Reduction

Next

Video Capture Rotation

On this page

Back to top