Domain name for API request: trtc.tencentcloudapi.com.
This API is used to enable On-Cloud MixTranscoding and specify the position of each channel of image in stream mixing.
There may be multiple channels of audio/video streams in a TRTC room. You can call this API to request the Tencent Cloud server to combine multiple channels of video images and audio into one channel and specify the position of each image so as to produce just one channel of audio/video stream for recording and live streaming. The mixing stops automatically after a room is destroyed.
You can use this API to perform the following operations:
Currently, On-Cloud MixTranscoding supports the following layout templates:
PlaceHolderMode
in LayoutParams
set to 1), but a user for whom a place is reserved is not sending video data, the position will show the corresponding placeholder image (PlaceImageId
).Note: only applications created on and after January 9, 2020 can call this API directly. Applications created before use the stream mixing service of LVB by default. If you want to switch to MCU On-Cloud MixTranscoding, please submit a ticket.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common parameter. The value used for this API: StartMCUMixTranscode. |
Version | Yes | String | Common parameter. The value used for this API: 2019-07-22. |
Region | Yes | String | Common parameter. For more information, please see the list of regions supported by the product. |
SdkAppId | Yes | Integer | SDKAppId of TRTC. |
RoomId | Yes | Integer | Room ID. |
OutputParams | Yes | OutputParams | On-Cloud MixTranscoding output control parameters. |
EncodeParams | Yes | EncodeParams | On-Cloud MixTranscoding output encoding parameters. |
LayoutParams | Yes | LayoutParams | On-Cloud MixTranscoding output layout parameters. |
PublishCdnParams | No | PublishCdnParams | Relayed push parameters of a non-Tencent Cloud CDN |
Parameter Name | Type | Description |
---|---|---|
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
This example shows you how to enable On-Cloud MixTranscoding for a specified room (ID: 3560) and specify the screen sharing template for the layout of each channel of video image.
Set the On-Cloud MixTranscoding parameters as follows:
main_pc
.https://trtc.tencentcloudapi.com/?Action=StartMCUMixTranscode
&SdkAppId=1400188366
&RoomId=3560
&OutputParams.StreamId=1400188366_3560_mix
&OutputParams.PureAudioStream=0
&OutputParams.RecordId=1400188366_3560_mix_file
&OutputParams.RecordAudioOnly=0
&EncodeParams.VideoWidth=1280
&EncodeParams.VideoHeight=720
&EncodeParams.VideoBitrate=1560
&EncodeParams.VideoFramerate=15
&EncodeParams.VideoGop=2
&EncodeParams.BackgroundColor=0
&EncodeParams.AudioSampleRate=48000
&EncodeParams.AudioBitrate=64
&EncodeParams.AudioChannels=2
&LayoutParams.Template=2
&LayoutParams.MainVideoUserId=main_pc
&LayoutParams.MainVideoStreamType=1
&<Common request parameters>
{
"Response": {
"RequestId": "eac6b301-a322-493a-8e36-83b295459397"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
FailedOperation.RequestRejection | The TencentCloud API On-Cloud MixTranscoding template conflicts with On-Cloud MixTranscoding settings in the SDK. |
FailedOperation.RoomNotExist | The room does not exist. |
InternalError | Internal error. |
InvalidParameter.AudioEncodeParams | Invalid audio codec parameter. |
InvalidParameter.EncodeParams | Invalid EncodeParams . |
InvalidParameter.MainVideoStreamType | Invalid stream type of the big image. |
InvalidParameter.OutputParams | Incorrect OutputParams parameter. |
InvalidParameter.PresetLayoutConfig | Incorrect parameters for custom layout. |
InvalidParameter.PureAudioStream | Incorrect parameters for audio-only stream pushing. |
InvalidParameter.RecordAudioOnly | Incorrect parameters for audio-only recording. |
InvalidParameter.RecordId | Incorrect RecordId parameter. |
InvalidParameter.RoomId | RoomId is incorrect. |
InvalidParameter.SdkAppId | SdkAppId is incorrect. |
InvalidParameter.SmallVideoLayoutParams | Invalid small image layout parameter. |
InvalidParameter.StreamId | Incorrect StreamId parameter. |
InvalidParameterValue.RoomId | Invalid RoomId. |
MissingParameter.AudioEncodeParams | Audio output parameters are missing in EncodeParams . |
MissingParameter.BizId | BizId missing in relayed push parameters. |
MissingParameter.EncodeParams | Missing EncodeParams parameter. |
MissingParameter.OutputParams | Missing OutputParams parameter. |
MissingParameter.PresetLayoutConfig | Custom layout parameter missing. |
MissingParameter.PublishCdnUrls | Destination missing in relayed push parameters. |
MissingParameter.RoomId | RoomId is missing. |
MissingParameter.SdkAppId | SdkAppId is missing. |
MissingParameter.StreamId | The StreamId parameter is missing in OutputParams . |
MissingParameter.VideoEncodeParams | Video output parameters are missing in EncodeParams . |
UnauthorizedOperation.SdkAppId | No permission to manipulate SdkAppId . |
Was this page helpful?