logo
On this page
2021-09-26

Stream playing issues

Products / Plugins:Video Call / Audio Call / Live streaming
Platform / Framework:iOS / Android / macOS / Windows / Web

Due to the abnormal exit of the push stream, the status is not synchronized to the server, and the server needs to determine that the stream has been deleted through timeout. The SDK will throw a notification of failure to pull the stream after more than 5 minutes. Developers can download from onPlayerStateUpdate Get related error codes in the pull stream state callback (please refer to Pull stream related error codes in Common error codes, When the error code is not 0, decide whether to try again or hang up directly.

The reason for this problem is: OBS pushes the B frame when pushing the stream, and ZegoExpress SDK pushes the stream without the B frame by default (because the B frame has a large delay in the live broadcast scene), so there will be a freeze or audio and picture out of sync phenomenon.

It is recommended to solve it in the following 3 ways:

  1. Set not to push B-frames in OBS: select "Advanced> Profile" for output mode, and select baseline or SDK with soft unpull stream. For the classic version of OBS, set the B frame in Advanced: "Advanced> Profile", select "baseline". If after setting this step in OBS, the pull flow becomes fuzzy for a while and clear for a while, please refer to Method 3 for handling.
  2. Set support for pulling B-frames in the SDK: call the interface enableCheckPoc(false) before Express pulls the stream, requireHardwareDecoder(false) can pull the B-frame video stream.
  3. Blurred for a while and clear for a while, which may be caused by the complicated bit rate of the picture that cannot be edited. There are three solutions as follows:
    • Increase bit rate
    • Increase CPU usage: select "Advanced> CPU Use Preset" for the output mode, for example, change it to medium. The more you use, the better the picture quality.
    • Set profile to main in OBS, and adjust the streaming end to support B frames.

The iOS system has a policy of prohibiting automatic playback of the WeChat browser, and does not allow the automatic playback of videos. It requires the user to manually click the play button of the video tag to trigger the playback action of the video tag.

<video id="vd_remote" playsinline controls>
</video>
  • Before logging in to the room, the user needs to subscribe to the stream update information in the room through zegoExpressEngine.on('roomStreamUpdate', callBack:(roomID,updateType,streamList) => void).
  • When there is a new stream in the room, "callBack" will be called back, and the stream update list can be obtained through "streamList". The attribute of the list member contains the corresponding CDN playback address (flv, rtmp, hls). After getting the CDN address, it cannot be played through the "startPlayingStream" interface, and plug-ins such as "flv.js" and "video.js" are needed.
  • Currently playing rtmp addresses on the Web platform depends on the flash plug-in. If the browser does not support flash plug-ins, the browser cannot play the rtmp address stream.
  • Safari is restricted to not play flv streams, only m3u8 or rtmp streams.
  • Delays of various streaming addresses: rtmp, flv: 2s ~ 5s, m3u8: 5s ~ 20s.
<video id="vd_remote" playsinline controls>
</video>

Consider the following implementation methods for the way that the web platform obtains the CDN streaming address:

  • If the CDN is applied for through the ZEGO platform, the streaming end can monitor the "roomStreamUpdate" callback to obtain the relevant streaming address. If you cannot get it, please contact ZEGO technical support.
  • If you are not applying for a CDN through the ZEGO platform, but you need to monitor the "roomStreamUpdate" callback on the streaming end to obtain the relevant streaming address, please contact ZEGO technical support;
  • If you do not use the SDK callback to implement this function, you need to synchronize the streaming address on the business side through the business server; or send streaming address information through the IM function of the ZEGO room.

The SDK does not support repeatedly pulling the same stream and rendering to different views. If you try to repeatedly pull a stream that is currently playing, an error will be reported.

Please contact ZEGO technical support and provide the "https" certificate of the pull domain name. After the certificate is configured by the technical support, you can use "https" to pull the flv address.

When the web platform uses flv format to play resources from CDN, it will automatically cache. When pausing or replaying, it will continue to play from the buffered data first, so a delay occurs. The longer the pause time, the greater the delay.

  1. The customer's business side manages the stream ID by itself, logs in to the room and simultaneously pulls the stream (in order to call "LoginRoom" first, and then directly call "startPlayingStream").
  2. Call "switchRoom" to switch rooms (call "loginRoom" when logging in for the first time, and then log out and log in to directly use "switchRoom").

The "uni-app" framework does not expose the "srcObject" property, and it needs to be rendered by native JavaScript.

The default number of concurrent streaming supported by the SDK is 12 (single user). If a single user has more than 12 concurrent streaming requirements, please contact ZEGO technical support.

Previous

How to add the Maven repositories in Android Studio version bumblebee?

Next

How can I listen for the event callbacks related to room users' login/logout in live streaming?