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 mix multiple channels of video images and audio into one channel and specify the position of each image so as to produce only one channel of audio/video stream for recording and live streaming.
You can use this API to perform the following operations:
Currently, On-Cloud MixTranscoding supports the following layout templates:
PlaceHolderMode
in LayoutParams
is 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
).Notes:
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: StartMCUMixTranscodeByStrRoomId. |
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. This API only supports: ap-beijing, ap-guangzhou |
SdkAppId | Yes | Integer | SDKAppId of TRTC |
StrRoomId | Yes | String | Room ID in string type |
OutputParams | Yes | OutputParams | On-Cloud MixTranscoding output 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: Room_3560
) and specify the screen sharing template for image layout.
The On-Cloud MixTranscoding parameters are as follows:
main_pc
occupies the left side of the screen as the big image.https://trtc.tencentcloudapi.com/?Action=StartMCUMixTranscodeByStrRoomId
&SdkAppId=1400188366
&StrRoomId=Room_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.SmallVideoStreamType | Invalid StreamType under SmallVideoLayoutParams . |
InvalidParameter.StreamId | Incorrect StreamId parameter. |
InvalidParameter.VideoResolution | Invalid video resolution. |
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.PublishCdnParams | Relaying parameter missing. |
MissingParameter.PublishCdnUrls | Destination missing in relayed push parameters. |
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?