How to handle the issue of video stuttering or audio-video out of sync when using OBS to publish and SDK to play?
Problem Description
When using OBS to publish and SDK to play, video stuttering or audio-video out of sync occurs.
Problem Cause
When using OBS to publish, the stream with B frames is published. Streams with B frames have large latency in live streaming scenarios. By default, ZEGO Express SDK does not support decoding streams with B frames, so video stuttering or audio-video out of sync occurs.
Solution
The following are 3 solutions recommended by ZEGO.
- Set OBS not to publish B frames
Set OBS not to publish B frames: Select "Advanced > Profile" in the output mode, and select baseline or use software decoding to play the stream with SDK.
If OBS is a classic version, set B frames in Advanced: "Advanced > Profile", select "baseline".
If you have set OBS not to publish B frames and the video appears blurry for a while and then clear for a while, please refer to Solution 3 for handling.
- Set SDK to support playing B frames
Call the interface enableCheckPoc(false), requireHardwareDecoder(false) before playing with Express, then you can play video streams with B frames.
- If the video appears blurry for a while and then clear for a while, it may be because the complex video cannot be encoded at the current bitrate. There are 3 solutions:
- Increase the bitrate
- Increase CPU usage: Select "Advanced > CPU usage preset" in the output mode, for example, change it to medium. The more CPU used, the better the video quality.
- Set profile to main in OBS, and the playing end needs to be adjusted to support B frames.

