Single Stream Transcoding
Overview
Single Stream Transcoding refers to converting a single original stream into transcoded streams with different encoding formats and resolutions on the cloud. In scenarios such as live streaming, viewers can choose streams with different resolutions based on network quality and device capabilities to ensure smooth playback.

Use Cases
- When developers provide video streams with multiple resolutions for on-demand viewing, the original stream needs to be converted into transcoded streams with different qualities. Single Stream Transcoding can be used in this scenario.
- When converting original video streams to different video encoding formats, Single Stream Transcoding can be used. For example, when some devices cannot decode H.265 due to performance limitations, transcoding to H.264 is required.
Prerequisites
Single Stream Transcoding is currently in beta. To access this feature, please contact ZEGOCLOUD sales or technical support.
Before using Single Stream Transcoding, ensure that:
-
You have created a project in the ZEGOCLOUD Console and applied for a valid AppID and AppSign. For details, refer to Console - Project Information.
-
You have integrated the ZEGO Express SDK into your project and implemented basic video call publish and play functionality. For details, refer to Quick Start - Integration and Quick Start - Implementation.
-
You need to use Live Streaming play, CDN relay play (play via streamID), or RTC play, without using stream mixing.
For scenarios that already use stream mixing, you can directly output multiple streams with different resolutions based on the stream mixing interface without triggering Single Stream Transcoding.
Implementation
The main process for Single Stream Transcoding is as follows:
- Add a transcoding template.
- Create the engine and log in to the room.
- Play the transcoded stream as needed. Choose the play method as Live Streaming play, CDN relay play (play via streamID), or RTC, and pass in the transcoding template ID to trigger transcoding.
1 Add Transcoding Template
Please contact ZEGOCLOUD technical support to add a transcoding template and obtain the corresponding transcoding template ID.
Currently supported transcoding parameters are: Template ID, Resolution, Bitrate, Frame Rate, and Video Encoding Format.
- Currently only video-related parameters are supported.
- One AppID supports adding up to 5 transcoding templates. To set up more templates, please contact ZEGOCLOUD technical support.
| Parameter | Description |
|---|---|
| Template ID | An integer greater than 100. The ID must be unique. It is recommended to name it based on the output resolution. For example, the template ID for transcoding output with 360P resolution can be named 360. If the transcoding output resolution is less than 100P, you can name it arbitrarily. |
| Resolution |
|
| Bitrate | The value must be greater than 0, in bps. |
| Frame Rate | Supported range: [1, 20], in fps. If you need to output a higher frame rate, please contact ZEGOCLOUD technical support for configuration. |
| Video Encoding Format | The following video encoding formats are supported:
|
2 Create Engine and Log in to Room
For specific procedures, refer to the Create Engine and Log in to Room sections in the "Implementing Video Call" document.
Before implementing Single Stream Transcoding, there must be an existing stream in the room.
3 Play Transcoded Stream
Configure the codecTemplateID property of ZegoPlayerConfig with the transcoding template ID obtained in Step 1: Add Transcoding Template, and start playing the stream.
ZegoPlayerConfig playerConfig = ZegoPlayerConfig.defaultConfig();
// Configure according to actual business requirements
playerConfig.resourceMode = ZegoStreamResourceMode.OnlyL3;
// 101 is the configured template ID, refer to Step 1: Add Transcoding Template
playerConfig.codecTemplateID = 101;
ZegoCanvas playCanvas = ZegoCanvas(_playViewID);
// engine is the ZegoExpressEngine object created when creating the engine
ZegoExpressEngine.instance.startPlayingStream("streamID", canvas:playCanvas, config:playerConfig);FAQ
What is the difference between stream mixing and Single Stream Transcoding?
- Stream mixing is generally used to merge multiple input streams into one, while supporting the configuration of encoding formats, resolutions, and other parameters for multiple output streams. Stream mixing transcoding requires developers to additionally call client-side or server-side interfaces to trigger.
- Single Stream Transcoding is used to implement transcoding for a single stream, without requiring developers to additionally call client-side or server-side interfaces to trigger. It only needs to be triggered by passing template parameters when playing the stream.
