What are big and small streams?
2023-06-29
Products / Plugins:Video Call
Platform / Framework:Android / iOS
The big and small streams we refer to are layered video encoding, which divides the bitstream into a base layer (small stream) and an extension layer (big stream). After enabling layered video encoding on the publishing end, the pulling end will pull the appropriate video layer by default according to network conditions. For example, when the network is poor, only the base layer (small stream) is pulled. You can call setPlayStreamVideoType to set the video layer you want to pull. The currently supported types are as follows:
| Enum Value | Description |
|---|---|
| ZegoVideoStreamTypeDefault | Automatically select the stream type based on network status. Default value. ZEGOCLOUD will automatically choose to pull the base layer (small stream) or extension layer (big stream) based on the situation. |
| ZegoVideoStreamTypeSmall | Base layer, small resolution type, i.e., small stream |
| ZegoVideoStreamTypeBig | Extension layer, large resolution type, i.e., big stream |
Taking pulling the extension layer (big stream) as an example:
iOS
[[ZegoExpressEngine sharedEngine] setPlayStreamVideoType:ZegoVideoStreamTypeBig streamID:self.streamID];
[[ZegoExpressEngine sharedEngine] startPlayingStream:self.streamID canvas:playCanvas];Android
engine.setPlayStreamVideoType(playStreamID,ZegoVideoStreamType.BIG);
engine.startPlayingStream(playStreamID);C++
engine->setPlayStreamVideoType(playStreamID,ZEGO_VIDEO_STREAM_TYPE_BIG);
engine->startPlayingStream(playStreamID, &playCanvas);