logo
On this page

ZegoVideoConfig

ZegoVideoConfig

Video config.

Details

Configure parameters used for publishing stream, such as bitrate, frame rate, and resolution. Developers should note that the width and height resolution of the mobile and desktop are opposite. For example, 360p, the resolution of the mobile is 360x640, and the desktop is 640x360. When using external capture, the capture and encoding resolution of RTC cannot be set to 0*0, otherwise, there will be no video data in the publishing stream in the entire engine life cycle.

Declared in entity/ZegoVideoConfig.java

Properties

captureWidth

captureWidth
public int captureWidth

Capture resolution width, control the width of camera image acquisition. SDK requires this member to be set to an even number. Only the camera is not started and the custom video capture is not used, the setting is effective. For performance reasons, the SDK scales the video frame to the encoding resolution after capturing from camera and before rendering to the preview view. Therefore, the resolution of the preview image is the encoding resolution. If you need the resolution of the preview image to be this value, Please call [setCapturePipelineScaleMode] first to change the capture pipeline scale mode to [Post]

captureHeight

captureHeight
public int captureHeight

Capture resolution height, control the height of camera image acquisition. SDK requires this member to be set to an even number. Only the camera is not started and the custom video capture is not used, the setting is effective. For performance reasons, the SDK scales the video frame to the encoding resolution after capturing from camera and before rendering to the preview view. Therefore, the resolution of the preview image is the encoding resolution. If you need the resolution of the preview image to be this value, Please call [setCapturePipelineScaleMode] first to change the capture pipeline scale mode to [Post]

encodeWidth

encodeWidth
public int encodeWidth

Encode resolution width, control the image width of the encoder when publishing stream. SDK requires this member to be set to an even number. The settings before and after publishing stream can be effective

encodeHeight

encodeHeight
public int encodeHeight

Encode resolution height, control the image height of the encoder when publishing stream. SDK requires this member to be set to an even number. The settings before and after publishing stream can be effective

fps

fps
public int fps

Frame rate, control the frame rate of the camera and the frame rate of the encoder. Publishing stream set to 60 fps, playing stream to take effect need contact technical support

bitrate

bitrate
public int bitrate

Bit rate in kbps. The settings before and after publishing stream can be effective. The SDK will automatically set the bit rate suitable for the scenario selected by the developer. If the bit rate manually set by the developer exceeds the reasonable range, the SDK will automatically process the bit rate according to the reasonable range. If you need to configure a high bit rate due to business needs, please contact ZEGO Business.

codecID

codecID
public ZegoVideoCodecID codecID

The codec id to be used, the default value is [default]. Settings only take effect before publishing stream

keyFrameInterval

keyFrameInterval
public int keyFrameInterval
  • Required: No.
  • Default value: 2 seconds.
  • Value range: [2, 5].
  • Caution: The setting is only valid before pushing.

Methods

ZegoVideoConfig

ZegoVideoConfig
Create video configuration with preset enumeration values
Declared in entity/ZegoVideoConfig.java

ZegoVideoConfig

ZegoVideoConfig
Create default video configuration(360p, 15fps, 600000bps)
Declared in entity/ZegoVideoConfig.java

360p, 15fps, 600kbps

setCaptureResolution

setCaptureResolution
public void setCaptureResolution(int width, int height)
Capture resolution, control the resolution of camera image acquisition. SDK requires the width and height to be set to even numbers. Only the camera is not started and the custom video capture is not used, the setting is effective. For performance reasons, the SDK scales the video frame to the encoding resolution after capturing from camera and before rendering to the preview view. Therefore, the resolution of the preview image is the encoding resolution. If you need the resolution of the preview image to be this value, Please call [setCapturePipelineScaleMode] first to change the capture pipeline scale mode to [Post]
Declared in entity/ZegoVideoConfig.java

setEncodeResolution

setEncodeResolution
public void setEncodeResolution(int width, int height)
Encode resolution, control the image resolution of the encoder when publishing stream. SDK requires the width and height to be set to even numbers. The settings before and after publishing stream can be effective
Declared in entity/ZegoVideoConfig.java

setVideoFPS

setVideoFPS
public void setVideoFPS(int fps)
Frame rate, control the frame rate of the camera and the frame rate of the encoder. Publishing stream set to 60 fps, playing stream to take effect need contact technical support
Declared in entity/ZegoVideoConfig.java

setVideoBitrate

setVideoBitrate
public void setVideoBitrate(int bitrate)
Bit rate in kbps. The settings before and after publishing stream can be effective. The SDK will automatically set the bit rate suitable for the scenario selected by the developer. If the bit rate manually set by the developer exceeds the reasonable range, the SDK will automatically process the bit rate according to the reasonable range. If you need to configure a high bit rate due to business needs, please contact ZEGO Business.
Declared in entity/ZegoVideoConfig.java

setCodecID

setCodecID
public void setCodecID(ZegoVideoCodecID codecID)
The codec id to be used, the default value is [default]. Settings only take effect before publishing stream
Declared in entity/ZegoVideoConfig.java

Previous

zegouser

Next

zegovideodenoiseparams

On this page

Back to top