Products / Plugins
Platform / Framework

Stream playing issues

Products / Plugins:Video Call / Voice Call / Live Streaming

Platform / Framework:iOS / Android / macOS / Windows / Web

Last updated:2021-09-26 15:20

1. After both parties have completed the push and pull streaming, if one party stops the streaming due to shutdown and exits the program, how long does it take for the streaming party to receive an error message?

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.

2. Using OBS to push the stream, when the SDK pulls the stream, the picture freezes or the audio and video are out of sync.

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.
3. When the web platform pushes the stream normally, only the Android platform can use the WeChat browser to pull the stream normally, and the iOS platform cannot pull the stream, but there is data in onPlayerQualityUpdate?

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>
4. How does the web platform realize streaming from CDN? Which one of the "rtmp, hls, flv" addresses is preferred for streaming?
  • 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>
5. How does the web platform obtain the CDN streaming address?

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.
6. An error is reported when the web platform is streaming: "Player already exist!" What is the reason?

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.

7. The web platform uses "https" to go online, but the flv streaming address returned by the SDK is "http", which is not compatible. How to solve it?

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.

8. The web platform pulls the stream from the CDN and uses the flv format to play. Why does the pause and then play cause the delay to accumulate?

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.

9. In scenes that need to switch rooms frequently, the rendering speed of the streaming screen is relatively slow, how to optimize?
  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").
10. When using the "uni-app" framework, when the stream is pulled, "playerStateUpdate" shows that the stream is successfully pulled, but the screen cannot be rendered using "srcObject"?

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

11. How many streams can a user support at the same time?

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.

Page Directory
Download PDF