FuncList | DESC |
Room entry parameters | |
Video encoding parameters | |
Network QoS control parameter set | |
Rendering parameters of video image | |
Network quality | |
Volume | |
Network speed testing parameters | |
Network speed test result | |
Video texture data | |
Video frame information | |
Audio frame data | |
Description information of each video image in On-Cloud MixTranscoding | |
Layout and transcoding parameters of On-Cloud MixTranscoding | |
Push parameters required to be set when publishing audio/video streams to non-Tencent Cloud CDN | |
Local audio file recording parameters | |
Local media file recording parameters | |
Sound effect parameter (disused) | |
Room switch parameter | |
Format parameter of custom audio callback | |
Structure for storing window thumbnails and icons. | |
The users whose streams to publish | |
The destination URL when you publish to Tencent Cloud or a third-party CDN | |
The publishing destination | |
The video layout of the transcoded stream | |
The watermark layout | |
The encoding parameters | |
The transcoding parameters | |
Media Stream Private Encryption Configuration | |
Volume evaluation and other related parameter settings. |
EnumType | DESC |
Video resolution | |
Video aspect ratio mode | |
Video stream type | |
Video image fill mode | |
Video image rotation direction | |
Beauty (skin smoothing) filter algorithm | |
Video pixel format | |
Video data transfer method | |
Video mirror type | |
Data source of local video screenshot | |
Use cases | |
Role | |
QoS control mode (disused) | |
Image quality preference | |
Network quality | |
Audio/Video playback status | |
Reasons for playback status changes | |
Sound quality | |
Audio frame content format | |
Audio callback data operation mode | |
Log level | |
Screen sharing target type (for desktops only) | |
Layout mode of On-Cloud MixTranscoding | |
Media recording type | |
Stream mix input type | |
Watermark image source type | |
Audio recording content type | |
The publishing mode | |
Encryption Algorithm | |
Speed Test Scene | |
Set the adaptation mode of gravity sensing (only applicable to mobile terminals) |
Portrait
must be selected for TRTCVideoResolutionMode
.Enum | Value | DESC |
TRTCVideoResolution_120_120 | 1 | Aspect ratio: 1:1; resolution: 120x120; recommended bitrate (VideoCall): 80 Kbps; recommended bitrate (LIVE): 120 Kbps. |
TRTCVideoResolution_160_160 | 3 | Aspect ratio: 1:1; resolution: 160x160; recommended bitrate (VideoCall): 100 Kbps; recommended bitrate (LIVE): 150 Kbps. |
TRTCVideoResolution_270_270 | 5 | Aspect ratio: 1:1; resolution: 270x270; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps. |
TRTCVideoResolution_480_480 | 7 | Aspect ratio: 1:1; resolution: 480x480; recommended bitrate (VideoCall): 350 Kbps; recommended bitrate (LIVE): 500 Kbps. |
TRTCVideoResolution_160_120 | 50 | Aspect ratio: 4:3; resolution: 160x120; recommended bitrate (VideoCall): 100 Kbps; recommended bitrate (LIVE): 150 Kbps. |
TRTCVideoResolution_240_180 | 52 | Aspect ratio: 4:3; resolution: 240x180; recommended bitrate (VideoCall): 150 Kbps; recommended bitrate (LIVE): 250 Kbps. |
TRTCVideoResolution_280_210 | 54 | Aspect ratio: 4:3; resolution: 280x210; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps. |
TRTCVideoResolution_320_240 | 56 | Aspect ratio: 4:3; resolution: 320x240; recommended bitrate (VideoCall): 250 Kbps; recommended bitrate (LIVE): 375 Kbps. |
TRTCVideoResolution_400_300 | 58 | Aspect ratio: 4:3; resolution: 400x300; recommended bitrate (VideoCall): 300 Kbps; recommended bitrate (LIVE): 450 Kbps. |
TRTCVideoResolution_480_360 | 60 | Aspect ratio: 4:3; resolution: 480x360; recommended bitrate (VideoCall): 400 Kbps; recommended bitrate (LIVE): 600 Kbps. |
TRTCVideoResolution_640_480 | 62 | Aspect ratio: 4:3; resolution: 640x480; recommended bitrate (VideoCall): 600 Kbps; recommended bitrate (LIVE): 900 Kbps. |
TRTCVideoResolution_960_720 | 64 | Aspect ratio: 4:3; resolution: 960x720; recommended bitrate (VideoCall): 1000kbps; recommended bitrate (LIVE): 1500kbps。 |
TRTCVideoResolution_160_90 | 100 | Aspect ratio: 16:9; resolution: 160x90; recommended bitrate (VideoCall): 150 Kbps; recommended bitrate (LIVE): 250 Kbps. |
TRTCVideoResolution_256_144 | 102 | Aspect ratio: 16:9; resolution: 256x144; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps. |
TRTCVideoResolution_320_180 | 104 | Aspect ratio: 16:9; resolution: 320x180; recommended bitrate (VideoCall): 250 Kbps; recommended bitrate (LIVE): 400 Kbps. |
TRTCVideoResolution_480_270 | 106 | Aspect ratio: 16:9; resolution: 480x270; recommended bitrate (VideoCall): 350 Kbps; recommended bitrate (LIVE): 550 Kbps. |
TRTCVideoResolution_640_360 | 108 | Aspect ratio: 16:9; resolution: 640x360; recommended bitrate (VideoCall): 500 Kbps; recommended bitrate (LIVE): 900 Kbps. |
TRTCVideoResolution_960_540 | 110 | Aspect ratio: 16:9; resolution: 960x540; recommended bitrate (VideoCall): 850 Kbps; recommended bitrate (LIVE): 1300 Kbps. |
TRTCVideoResolution_1280_720 | 112 | Aspect ratio: 16:9; resolution: 1280x720; recommended bitrate (VideoCall): 1200 Kbps; recommended bitrate (LIVE): 1800 Kbps. |
TRTCVideoResolution_1920_1080 | 114 | Aspect ratio: 16:9; resolution: 1920x1080; recommended bitrate (VideoCall): 2000 Kbps; recommended bitrate (LIVE): 3000 Kbps. |
TRTCVideoResolution
. If the portrait resolution (e.g., 360x640) needs to be used, Portrait
must be selected for TRTCVideoResolutionMode
.Enum | Value | DESC |
TRTCVideoResolutionModeLandscape | 0 | Landscape resolution, such as TRTCVideoResolution_640_360 + TRTCVideoResolutionModeLandscape = 640x360. |
TRTCVideoResolutionModePortrait | 1 | Portrait resolution, such as TRTCVideoResolution_640_360 + TRTCVideoResolutionModePortrait = 360x640. |
Enum | Value | DESC |
TRTCVideoStreamTypeBig | 0 | HD big image: it is generally used to transfer video data from the camera. |
TRTCVideoStreamTypeSmall | 1 | Smooth small image: it has the same content as the big image, but with lower resolution and bitrate and thus lower definition. |
TRTCVideoStreamTypeSub | 2 | Substream image: it is generally used for screen sharing. Only one user in the room is allowed to publish the substream video image at any time, while other users must wait for this user to close the substream before they can publish their own substream. |
Enum | Value | DESC |
TRTCVideoFillMode_Fill | 0 | Fill mode: the video image will be centered and scaled to fill the entire display area, where parts that exceed the area will be cropped. The displayed image may be incomplete in this mode. |
TRTCVideoFillMode_Fit | 1 | Fit mode: the video image will be scaled based on its long side to fit the display area, where the short side will be filled with black bars. The displayed image is complete in this mode, but there may be black bars. |
Enum | Value | DESC |
TRTCVideoRotation0 | 0 | No rotation |
TRTCVideoRotation90 | 1 | Clockwise rotation by 90 degrees |
TRTCVideoRotation180 | 2 | Clockwise rotation by 180 degrees |
TRTCVideoRotation270 | 3 | Clockwise rotation by 270 degrees |
Enum | Value | DESC |
TRTCBeautyStyleSmooth | 0 | Smooth style, which uses a more radical algorithm for more obvious effect and is suitable for show live streaming. |
TRTCBeautyStyleNature | 1 | Natural style, which retains more facial details for more natural effect and is suitable for most live streaming use cases. |
Enum | Value | DESC |
TRTCVideoPixelFormat_Unknown | 0 | Undefined format |
TRTCVideoPixelFormat_I420 | 1 | YUV420P (I420) format |
TRTCVideoPixelFormat_Texture_2D | 2 | OpenGL 2D texture format |
TRTCVideoPixelFormat_BGRA32 | 3 | BGRA32 format |
TRTCVideoPixelFormat_NV21 | 4 | NV21 format |
TRTCVideoPixelFormat_RGBA32 | 5 | RGBA format |
Enum | Value | DESC |
TRTCVideoBufferType_Unknown | 0 | Undefined transfer method |
TRTCVideoBufferType_Buffer | 1 | Use memory buffer to transfer video data. iOS: PixelBuffer ; Android: Direct Buffer for JNI layer; Windows: memory data block. |
TRTCVideoBufferType_Texture | 3 | Use OpenGL texture to transfer video data |
TRTCVideoBufferType_TextureD3D11 | 4 | Use D3D11 texture to transfer video data |
Enum | Value | DESC |
TRTCVideoMirrorType_Auto | 0 | Auto mode: mirror the front camera's image but not the rear camera's image (for mobile devices only). |
TRTCVideoMirrorType_Enable | 1 | Mirror the images of both the front and rear cameras. |
TRTCVideoMirrorType_Disable | 2 | Disable mirroring for both the front and rear cameras. |
Enum | Value | DESC |
TRTCSnapshotSourceTypeStream | 0 | The SDK screencaptures the native video content from the video stream. The screenshots are not controlled by the display of the rendering control. |
TRTCSnapshotSourceTypeView | 1 | The SDK screencaptures the displayed video content from the rendering control, which can achieve the effect of WYSIWYG, but if the display area is too small, the screenshots will also be very small. |
TRTCSnapshotSourceTypeCapture | 2 | The SDK screencaptures the capture video content from the capture control, which can capture the captured high-definition screenshots. |
LIVE
(audio + video) and VoiceChatRoom
(pure audio). VideoCall
(audio + video) and AudioCall
(pure audio).Enum | Value | DESC |
TRTCAppSceneVideoCall | 0 | In the video call scenario, 720p and 1080p HD image quality is supported. A single room can sustain up to 300 concurrent online users, and up to 50 of them can speak simultaneously. Use cases: [one-to-one video call], [video conferencing with up to 300 participants], [online medical diagnosis], [small class], [video interview], etc. |
TRTCAppSceneLIVE | 1 | In the interactive video live streaming scenario, mic can be turned on/off smoothly without waiting for switchover, and the anchor latency is as low as less than 300 ms. Live streaming to hundreds of thousands of concurrent users in the audience role is supported with the playback latency down to 1,000 ms. Use cases: [low-latency interactive live streaming], [big class], [anchor competition], [video dating room], [online interactive classroom], [remote training], [large-scale conferencing], etc. Note In this scenario, you must use the role field in TRTCParams to specify the role of the current user. |
TRTCAppSceneAudioCall | 2 | Audio call scenario, where the SPEECH sound quality is used by default. A single room can sustain up to 300 concurrent online users, and up to 50 of them can speak simultaneously.Use cases: [one-to-one audio call], [audio conferencing with up to 300 participants], [audio chat], [online Werewolf], etc. |
TRTCAppSceneVoiceChatRoom | 3 | In the interactive audio live streaming scenario, mic can be turned on/off smoothly without waiting for switchover, and the anchor latency is as low as less than 300 ms. Live streaming to hundreds of thousands of concurrent users in the audience role is supported with the playback latency down to 1,000 ms. Use cases: [audio club], [online karaoke room], [music live room], [FM radio], etc. Note In this scenario, you must use the role field in TRTCParams to specify the role of the current user. |
TRTCAppSceneLIVE
and TRTCAppSceneVoiceChatRoom
). Users are divided into two roles:Enum | Value | DESC |
TRTCRoleAnchor | 20 | An anchor can publish their audio/video streams. There is a limit on the number of anchors. Up to 50 anchors are allowed to publish streams at the same time in one room. |
TRTCRoleAudience | 21 | Audience can only listen to or watch audio/video streams of anchors in the room. If they want to publish their streams, they need to switch to the "anchor" role first through switchRole. One room can sustain up to 100,000 concurrent online users in the audience role. |
Enum | Value | DESC |
TRTCQosControlModeClient | 0 | Client-based control, which is for internal debugging of SDK and shall not be used by users. |
TRTCQosControlModeServer | 1 | On-cloud control, which is the default and recommended mode. |
Enum | Value | DESC |
TRTCVideoQosPreferenceSmooth | 1 | Ensuring smoothness: in this mode, when the current network is unable to transfer a clear and smooth video image, the smoothness of the image will be given priority, but there will be blurs. |
TRTCVideoQosPreferenceClear | 2 | Ensuring clarity (default value): in this mode, when the current network is unable to transfer a clear and smooth video image, the clarity of the image will be given priority, but there will be lags. |
Excellent
indicates the best, and Down
indicates the worst.Enum | Value | DESC |
TRTCQuality_Unknown | 0 | Undefined |
TRTCQuality_Excellent | 1 | The current network is excellent |
TRTCQuality_Good | 2 | The current network is good |
TRTCQuality_Poor | 3 | The current network is fair |
TRTCQuality_Bad | 4 | The current network is bad |
TRTCQuality_Vbad | 5 | The current network is very bad |
TRTCQuality_Down | 6 | The current network cannot meet the minimum requirements of TRTC |
Enum | Value | DESC |
TRTCAVStatusStopped | 0 | Stopped |
TRTCAVStatusPlaying | 1 | Playing |
TRTCAVStatusLoading | 2 | Loading |
Enum | Value | DESC |
TRTCAVStatusChangeReasonInternal | 0 | Default value |
TRTCAVStatusChangeReasonBufferingBegin | 1 | The stream enters the Loading state due to network congestion |
TRTCAVStatusChangeReasonBufferingEnd | 2 | The stream enters the Playing state after network recovery |
TRTCAVStatusChangeReasonLocalStarted | 3 | As a start-related API was directly called locally, the stream enters the Playing state |
TRTCAVStatusChangeReasonLocalStopped | 4 | As a stop-related API was directly called locally, the stream enters the Stopped state |
TRTCAVStatusChangeReasonRemoteStarted | 5 | As the remote user started (or resumed) publishing the audio or video stream, the stream enters the Loading or Playing state |
TRTCAVStatusChangeReasonRemoteStopped | 6 | As the remote user stopped (or paused) publishing the audio or video stream, the stream enters the "Stopped" state |
Speech
and Music
. In this mode, the reproduction of music is better than that in Speech
mode, and the amount of transferred data is much lower than that in Music
mode; therefore, this mode has good adaptability to various scenarios.Enum | Value | DESC |
TRTCAudioQualitySpeech | 1 | Speech mode: sample rate: 16 kHz; mono channel; bitrate: 16 Kbps. This mode has the best resistance among all modes and is suitable for audio call scenarios, such as online meeting and audio call. |
TRTCAudioQualityDefault | 2 | Default mode: sample rate: 48 kHz; mono channel; bitrate: 50 Kbps. This mode is between the speech mode and the music mode as the default mode in the SDK and is recommended. |
TRTCAudioQualityMusic | 3 | Music mode: sample rate: 48 kHz; full-band stereo; bitrate: 128 Kbps. This mode is suitable for scenarios where Hi-Fi music transfer is required, such as online karaoke and music live streaming. |
Enum | Value | DESC |
TRTCAudioFrameFormatNone | 0 | None |
TRTCAudioFrameFormatPCM | Not Defined | Audio data in PCM format |
Enum | Value | DESC |
TRTCAudioFrameOperationModeReadWrite | 0 | Read-write mode: You can get and modify the audio data of the callback, the default mode. |
TRTCAudioFrameOperationModeReadOnly | 1 | Read-only mode: Get audio data from callback only. |
TRTCLogLevelInfo
generally.Enum | Value | DESC |
TRTCLogLevelVerbose | 0 | Output logs at all levels |
TRTCLogLevelDebug | 1 | Output logs at the DEBUG, INFO, WARNING, ERROR, and FATAL levels |
TRTCLogLevelInfo | 2 | Output logs at the INFO, WARNING, ERROR, and FATAL levels |
TRTCLogLevelWarn | 3 | Output logs at the WARNING, ERROR, and FATAL levels |
TRTCLogLevelError | 4 | Output logs at the ERROR and FATAL levels |
TRTCLogLevelFatal | 5 | Output logs at the FATAL level |
TRTCLogLevelNone | 6 | Do not output any SDK logs |
Enum | Value | DESC |
TRTCScreenCaptureSourceTypeUnknown | -1 | Undefined |
TRTCScreenCaptureSourceTypeWindow | 0 | The screen sharing target is the window of an application |
TRTCScreenCaptureSourceTypeScreen | 1 | The screen sharing target is the entire screen |
TRTCScreenCaptureSourceTypeCustom | 2 | The screen sharing target is a user-defined data source |
Enum | Value | DESC |
TRTCTranscodingConfigMode_Unknown | 0 | Undefined |
TRTCTranscodingConfigMode_Manual | 1 | Manual layout mode In this mode, you need to specify the precise position of each video image. This mode has the highest degree of freedom, but its ease of use is the worst: You need to enter all the parameters in TRTCTranscodingConfig , including the position coordinates of each video image (TRTCMixUser). You need to listen on the onUserVideoAvailable() and onUserAudioAvailable() event callbacks in TRTCCloudDelegate and constantly adjust the mixUsers parameter according to the audio/video status of each user with mic on in the current room. |
TRTCTranscodingConfigMode_Template_PureAudio | 2 | Pure audio mode This mode is suitable for pure audio scenarios such as audio call (AudioCall) and audio chat room (VoiceChatRoom). You only need to set it once through the setMixTranscodingConfig() API after room entry, and then the SDK will automatically mix the audio of all mic-on users in the room into the current user's live stream. You don't need to set the mixUsers parameter in TRTCTranscodingConfig ; instead, you only need to set the audioSampleRate , audioBitrate and audioChannels parameters. |
TRTCTranscodingConfigMode_Template_PresetLayout | 3 | Preset layout mode This is the most popular layout mode, because it allows you to set the position of each video image in advance through placeholders, and then the SDK automatically adjusts it dynamically according to the number of video images in the room. In this mode, you still need to set the mixUsers parameter, but you can set userId as a "placeholder". Placeholder values include: "$PLACE_HOLDER_REMOTE$": image of remote user. Multiple images can be set. "$PLACE_HOLDER_LOCAL_MAIN$": local camera image. Only one image can be set. "$PLACE_HOLDER_LOCAL_SUB$": local screen sharing image. Only one image can be set. In this mode, you don't need to listen on the onUserVideoAvailable() and onUserAudioAvailable() callbacks in TRTCCloudDelegate to make real-time adjustments.Instead, you only need to call setMixTranscodingConfig() once after successful room entry. Then, the SDK will automatically populate the placeholders you set with real userId values. |
TRTCTranscodingConfigMode_Template_ScreenSharing | 4 | Screen sharing mode This mode is suitable for screen sharing-based use cases such as online education and supported only by the SDKs for Windows and macOS. In this mode, the SDK will first build a canvas according to the target resolution you set (through the videoWidth and videoHeight parameters). Before the teacher enables screen sharing, the SDK will scale up the teacher's camera image and draw it onto the canvas. After the teacher enables screen sharing, the SDK will draw the video image shared on the screen onto the same canvas. The purpose of this layout mode is to ensure consistency in the output resolution of the mixtranscoding module and avoid problems with blurred screen during course replay and webpage playback (web players don't support adjustable resolution). Meanwhile, the audio of mic-on students will be mixed into the teacher's audio/video stream by default. Video content is primarily the shared screen in teaching mode, and it is a waste of bandwidth to transfer camera image and screen image at the same time. Therefore, the recommended practice is to directly draw the camera image onto the current screen through the setLocalVideoRenderCallback API.In this mode, you don't need to set the mixUsers parameter in TRTCTranscodingConfig , and the SDK will not mix students' images so as not to interfere with the screen sharing effect.You can set width x height in TRTCTranscodingConfig to 0 px x 0 px, and the SDK will automatically calculate a suitable resolution based on the aspect ratio of the user's current screen. If the teacher's current screen width is less than or equal to 1920 px, the SDK will use the actual resolution of the teacher's current screen. If the teacher's current screen width is greater than 1920 px, the SDK will select one of the three resolutions of 1920x1080 (16:9), 1920x1200 (16:10), and 1920x1440 (4:3) according to the current screen aspect ratio. |
Enum | Value | DESC |
TRTCLocalRecordType_Audio | 0 | Record audio only |
TRTCLocalRecordType_Video | 1 | Record video only |
TRTCLocalRecordType_Both | 2 | Record both audio and video |
Enum | Value | DESC |
TRTCMixInputTypeUndefined | 0 | Default. Considering the compatibility with older versions, if you specify the inputType as Undefined, the SDK will determine the stream mix input type according to the value of the pureAudio parameter |
TRTCMixInputTypeAudioVideo | 1 | Mix both audio and video |
TRTCMixInputTypePureVideo | 2 | Mix video only |
TRTCMixInputTypePureAudio | 3 | Mix audio only |
TRTCMixInputTypeWatermark | 4 | Mix watermark In this case, you don't need to specify the userId parameter, but you need to specify the image parameter. It is recommended to use png format. |
Enum | Value | DESC |
TRTCWaterMarkSrcTypeFile | 0 | Path of the image file, which can be in BMP, GIF, JPEG, PNG, TIFF, Exif, WMF, or EMF format |
TRTCWaterMarkSrcTypeBGRA32 | 1 | Memory block in BGRA32 format |
TRTCWaterMarkSrcTypeRGBA32 | 2 | Memory block in RGBA32 format |
Enum | Value | DESC |
TRTCAudioRecordingContentAll | 0 | Record both local and remote audio |
TRTCAudioRecordingContentLocal | 1 | Record local audio only |
TRTCAudioRecordingContentRemote | 2 | Record remote audio only |
Enum | Value | DESC |
TRTCPublishModeUnknown | 0 | Undefined |
TRTCPublishBigStreamToCdn | 1 | Use this parameter to publish the primary stream (TRTCVideoStreamTypeBig) in the room to Tencent Cloud or a third-party CDN (only RTMP is supported). |
TRTCPublishSubStreamToCdn | 2 | Use this parameter to publish the substream (TRTCVideoStreamTypeSub) in the room to Tencent Cloud or a third-party CDN (only RTMP is supported). |
TRTCPublishMixStreamToCdn | 3 | Use this parameter together with the encoding parameter TRTCStreamEncoderParam and On-Cloud MixTranscoding parameter TRTCStreamMixingConfig to transcode the streams you specify and publish the mixed stream to Tencent Cloud or a third-party CDN (only RTMP is supported). |
TRTCPublishMixStreamToRoom | 4 | Use this parameter together with the encoding parameter TRTCStreamEncoderParam and On-Cloud MixTranscoding parameter TRTCStreamMixingConfig to transcode the streams you specify and publish the mixed stream to the room you specify. Use TRTCUser in TRTCPublishTarget to specify the robot that publishes the transcoded stream to a TRTC room. |
Enum | Value | DESC |
TRTCEncryptionAlgorithmAes128Gcm | 0 | AES GCM 128。 |
TRTCEncryptionAlgorithmAes256Gcm | 1 | AES GCM 256。 |
Enum | Value | DESC |
TRTCSpeedTestScene_DelayTesting | 1 | Delay testing. |
TRTCSpeedTestScene_DelayAndBandwidthTesting | 2 | Delay and bandwidth testing. |
TRTCSpeedTestScene_OnlineChorusTesting | 3 | Online chorus testing. |
Enum | Value | DESC |
TRTCGravitySensorAdaptiveMode_Disable | 0 | Turn off the gravity sensor and make a decision based on the current acquisition resolution and the set encoding resolution. If the two are inconsistent, rotate 90 degrees to ensure the maximum frame. |
TRTCGravitySensorAdaptiveMode_FillByCenterCrop | 1 | Turn on the gravity sensor to always ensure that the remote screen image is positive. When the intermediate process needs to deal with inconsistent resolutions, use the center cropping mode. |
TRTCGravitySensorAdaptiveMode_FitWithBlackBorder | 2 | Turn on the gravity sensor to always ensure that the remote screen image is positive. When the resolution needs to be processed inconsistently in the intermediate process, use the superimposed black border mode. |
roomId
or strRoomId
. roomId
and strRoomId
. roomId
and strRoomId
, because they are not interchangeable. For example, the number 123
and the string 123
are two completely different rooms in TRTC.EnumType | DESC |
businessInfo | Field description: business data, which is optional. This field is needed only by some advanced features. Recommended value: do not set this field on your own. |
privateMapKey | Field description: permission credential used for permission control, which is optional. If you want only users with the specified userId values to enter a room, you need to use privateMapKey to restrict the permission.Recommended value: we recommend you use this parameter only if you have high security requirements. For more information, please see Enabling Advanced Permission Control. |
role | Field description: role in the live streaming scenario, which is applicable only to the live streaming scenario (TRTCAppSceneLIVE or TRTCAppSceneVoiceChatRoom) but doesn't take effect in the call scenario. |
roomId | Field description: numeric room ID. Users (userId) in the same room can see one another and make audio/video calls. Recommended value: value range: 1–4294967294. @note roomId and strRoomId are mutually exclusive. If you decide to use strRoomId , then roomId should be entered as 0. If both are entered, roomId will be used.Note do not mix roomId and strRoomId , because they are not interchangeable. For example, the number 123 and the string 123 are two completely different rooms in TRTC. |
sdkAppId | Field description: application ID, which is required. Tencent Cloud generates bills based on sdkAppId .Recommended value: the ID can be obtained on the account information page in the TRTC console after the corresponding application is created. |
strRoomId | Field description: string-type room ID. Users (userId) in the same room can see one another and make audio/video calls. @note roomId and strRoomId are mutually exclusive. If you decide to use strRoomId , then roomId should be entered as 0. If both are entered, roomId will be used.Note do not mix roomId and strRoomId , because they are not interchangeable. For example, the number 123 and the string 123 are two completely different rooms in TRTC.Recommended value: the length limit is 64 bytes. The following 89 characters are supported: Uppercase and lowercase letters (a–z and A–Z) Digits (0–9) Space, "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", and ",". |
streamId | Field description: specified streamId in Tencent Cloud CSS, which is optional. After setting this field, you can play back the user's audio/video stream on Tencent Cloud CSS CDN through a standard pull scheme (FLV or HLS).Recommended value: this parameter can contain up to 64 bytes and can be left empty. We recommend you use sdkappid_roomid_userid_main as the streamid , which is easier to identify and will not cause conflicts in your multiple applications.Note to use Tencent Cloud CSS CDN, you need to enable the auto-relayed live streaming feature on the "Function Configuration" page in the console first. |
userDefineRecordId | Field description: on-cloud recording field, which is optional and used to specify whether to record the user's audio/video stream in the cloud. Recommended value: it can contain up to 64 bytes. Letters (a–z and A–Z), digits (0–9), underscores, and hyphens are allowed. Scheme 1. Manual recording 1. Enable on-cloud recording in "Application Management" > "On-cloud Recording Configuration" in the console. 2. Set "Recording Mode" to "Manual Recording". 3. After manual recording is set, in a TRTC room, only users with the userDefineRecordId parameter set will have video recording files in the cloud, while users without this parameter set will not.4. The recording file will be named in the format of "userDefineRecordId_start time_end time" in the cloud. Scheme 2. Auto-recording 1. You need to enable on-cloud recording in "Application Management" > "On-cloud Recording Configuration" in the console. 2. Set "Recording Mode" to "Auto-recording". 3. After auto-recording is set, any user who upstreams audio/video in a TRTC room will have a video recording file in the cloud. 4. The file will be named in the format of "userDefineRecordId_start time_end time". If userDefineRecordId is not specified, the file will be named in the format of "streamId_start time_end time". |
userId | Field description: user ID, which is required. It is the userId of the local user in UTF-8 encoding and acts as the username.Recommended value: if the ID of a user in your account system is "mike", userId can be set to "mike". |
userSig | Field description: user signature, which is required. It is the authentication signature corresponding to the current userId and acts as the login password for Tencent Cloud services. |
EnumType | DESC |
enableAdjustRes | Field description: whether to allow dynamic resolution adjustment. Once enabled, this field will affect on-cloud recording. Recommended value: this feature is suitable for scenarios that don't require on-cloud recording. After it is enabled, the SDK will intelligently select a suitable resolution according to the current network conditions to avoid the inefficient encoding mode of "large resolution + small bitrate". Note default value: false. If you need on-cloud recording, please do not enable this feature, because if the video resolution changes, the MP4 file recorded in the cloud cannot be played back normally by common players. |
minVideoBitrate | Field description: minimum video bitrate. The SDK will reduce the bitrate to as low as the value specified by minVideoBitrate to ensure the smoothness only if the network conditions are poor.Note: default value: 0, indicating that a reasonable value of the lowest bitrate will be automatically calculated by the SDK according to the resolution you specify. Recommended value: you can set the videoBitrate and minVideoBitrate parameters at the same time to restrict the SDK's adjustment range of the video bitrate: If you want to "ensure clarity while allowing lag in weak network environments", you can set minVideoBitrate to 60% of videoBitrate . If you want to "ensure smoothness while allowing blur in weak network environments", you can set minVideoBitrate to a low value, for example, 100 Kbps. If you set videoBitrate and minVideoBitrate to the same value, it is equivalent to disabling the adaptive adjustment capability of the SDK for the video bitrate. |
resMode | Field description: resolution mode (landscape/portrait) Recommended value: for mobile platforms (iOS and Android), Portrait is recommended; for desktop platforms (Windows and macOS), Landscape is recommended.Note to use a portrait resolution, please specify resMode as Portrait ; for example, when used together with Portrait , 640x360 represents 360x640. |
videoBitrate | Field description: target video bitrate. The SDK encodes streams at the target video bitrate and will actively reduce the bitrate only in weak network environments. Recommended value: please see the optimal bitrate for each specification in TRTCVideoResolution . You can also slightly increase the optimal bitrate.For example, TRTCVideoResolution_1280_720 corresponds to the target bitrate of 1,200 Kbps. You can also set the bitrate to 1,500 Kbps for higher definition.Note you can set the videoBitrate and minVideoBitrate parameters at the same time to restrict the SDK's adjustment range of the video bitrate: If you want to "ensure clarity while allowing lag in weak network environments", you can set minVideoBitrate to 60% of videoBitrate . If you want to "ensure smoothness while allowing blur in weak network environments", you can set minVideoBitrate to a low value, for example, 100 Kbps. If you set videoBitrate and minVideoBitrate to the same value, it is equivalent to disabling the adaptive adjustment capability of the SDK for the video bitrate. |
videoFps | Field description: video capturing frame rate Recommended value: 15 or 20 fps. If the frame rate is lower than 5 fps, there will be obvious lagging; if lower than 10 fps but higher than 5 fps, there will be slight lagging; if higher than 20 fps, the bandwidth will be wasted (the frame rate of movies is generally 24 fps). Note the front cameras on certain Android phones do not support a capturing frame rate higher than 15 fps. For some Android phones that focus on beautification features, the capturing frame rate of the front cameras may be lower than 10 fps. |
videoResolution | Field description: video resolution Recommended value For mobile video call, we recommend you select a resolution of 360x640 or below and select Portrait (portrait resolution) for resMode . For mobile live streaming, we recommend you select a resolution of 540x960 and select Portrait (portrait resolution) for resMode . For desktop platforms (Windows and macOS), we recommend you select a resolution of 640x360 or above and select Landscape (landscape resolution) for resMode .Note to use a portrait resolution, please specify resMode as Portrait ; for example, when used together with Portrait , 640x360 represents 360x640. |
EnumType | DESC |
controlMode | Field description: QoS control mode (disused) Recommended value: on-cloud control Note please set the on-cloud control mode (TRTCQosControlModeServer). |
preference | Field description: whether to ensure smoothness or clarity Recommended value: ensuring clarity Note this parameter mainly affects the audio/video performance of TRTC in weak network environments: Ensuring smoothness: in this mode, when the current network is unable to transfer a clear and smooth video image, the smoothness of the image will be given priority, but there will be blurs. See TRTCVideoQosPreferenceSmooth Ensuring clarity (default value): in this mode, when the current network is unable to transfer a clear and smooth video image, the clarity of the image will be given priority, but there will be lags. See TRTCVideoQosPreferenceClear |
EnumType | DESC |
fillMode | Field description: image fill mode Recommended value: fill (the image may be stretched or cropped) or fit (there may be black bars in unmatched areas). Default value: TRTCVideoFillMode_Fill |
mirrorType | Field description: image mirror mode |
rotation | Field description: clockwise image rotation angle Recommended value: rotation angles of 90, 180, and 270 degrees are supported. Default value: TRTCVideoRotation_0 |
EnumType | DESC |
quality | Network quality |
userId | User ID |
EnumType | DESC |
pitch | The local user's vocal frequency (unit: Hz), the value range is [0 - 4000]. For remote users, this value is always 0. |
spectrumData | Audio spectrum data, which divides the sound frequency into 256 frequency domains, spectrumData records the energy value of each frequency domain, The value range of each energy value is [-300, 0] in dBFS. Note The local spectrum is calculated using the audio data before encoding, which will be affected by the capture volume, BGM, etc.; the remote spectrum is calculated using the received audio data, and operations such as adjusting the remote playback volume locally will not affect it. |
spectrumDataLength | The length of recorded audio spectrum data, which is 256. |
userId | userId of the speaker. An empty value indicates the local user. |
vad | Vad result of the local user. 0: not speech 1: speech. |
volume | Volume of the speaker. Value range: 0–100. |
EnumType | DESC |
expectedDownBandwidth | Expected downstream bandwidth (kbps, value range: 10 to 5000, no downlink bandwidth test when it is 0). Note When the parameter scene is set to TRTCSpeedTestScene_OnlineChorusTesting , in order to obtain more accurate information such as rtt / jitter, the value range is limited to 10 ~ 1000. |
expectedUpBandwidth | Expected upstream bandwidth (kbps, value range: 10 to 5000, no uplink bandwidth test when it is 0). Note When the parameter scene is set to TRTCSpeedTestScene_OnlineChorusTesting , in order to obtain more accurate information such as rtt / jitter, the value range is limited to 10 ~ 1000. |
scene | Speed test scene. |
sdkAppId | |
userId | |
userSig |
EnumType | DESC |
availableDownBandwidth | Downstream bandwidth (in kbps, -1: invalid value). |
availableUpBandwidth | Upstream bandwidth (in kbps, -1: invalid value). |
downJitter | Downlink data packet jitter (ms) refers to the stability of data communication in the user's current network environment. The smaller the value, the better. The normal value range is 0ms - 100ms. -1 means that the speed test failed to obtain an effective value. Generally, the Jitter of the WiFi network will be slightly larger than that of the 4G/5G environment. |
downLostRate | Downstream packet loss rate between 0 and 1.0. For example, 0.2 indicates that 2 data packets may be lost in every 10 packets received from the server. |
errMsg | Error message for network speed test. |
ip | Server IP address. |
quality | Network quality, which is tested and calculated based on the internal evaluation algorithm. For more information, please see TRTCQuality |
rtt | Delay in milliseconds, which is the round-trip time between the current device and TRTC server. The smaller the value, the better. The normal value range is 10–100 ms. |
success | Whether the network speed test is successful. |
upJitter | Uplink data packet jitter (ms) refers to the stability of data communication in the user's current network environment. The smaller the value, the better. The normal value range is 0ms - 100ms. -1 means that the speed test failed to obtain an effective value. Generally, the Jitter of the WiFi network will be slightly larger than that of the 4G/5G environment. |
upLostRate | Upstream packet loss rate between 0 and 1.0. For example, 0.3 indicates that 3 data packets may be lost in every 10 packets sent to the server. |
EnumType | DESC |
glContext | Field description: The OpenGL context to which the texture corresponds, for Windows and Android. |
glTextureId | Field description: video texture ID |
} | Field description: The D3D11 texture, which is the pointer of ID3D11Texture2D, only for Windows. |
TRTCVideoFrame
is used to describe the raw data of a frame of the video image, which is the image data before frame encoding or after frame decoding.EnumType | DESC |
bufferType | Field description: video data structure type |
data | Field description: video data when bufferType is TRTCVideoBufferType_Buffer, which carries the memory data blocks for the C++ layer. |
height | Field description: video height Recommended value: please enter the height of the video data passed in. |
length | Field description: video data length in bytes. For I420, length = width * height * 3 / 2; for BGRA32, length = width * height * 4. |
rotation | Field description: clockwise rotation angle of video pixels |
texture | Field description: video data when bufferType is TRTCVideoBufferType_Texture, which carries the texture data used for OpenGL rendering. |
timestamp | Field description: video frame timestamp in milliseconds Recommended value: this parameter can be set to 0 for custom video capturing. In this case, the SDK will automatically set the timestamp field. However, please "evenly" set the calling interval of sendCustomVideoData . |
videoFormat | Field description: video pixel format |
width | Field description: video width Recommended value: please enter the width of the video data passed in. |
EnumType | DESC |
audioFormat | Field description: audio frame format |
channel | Field description: number of sound channels |
data | Field description: audio data |
extraData | Field description: extra data in audio frame, message sent by remote users through onLocalProcessedAudioFrame that add to audio frame will be callback through this field. |
extraDataLength | Field description: extra data length |
length | Field description: audio data length |
sampleRate | Field description: sample rate |
timestamp | Field description: timestamp in ms |
TRTCMixUser
is used to specify the location, size, layer, and stream type of each video image in On-Cloud MixTranscoding.EnumType | DESC |
image | Field description: specify the placeholder or watermark image. The placeholder image will be displayed when there is no upstream video.A watermark image is a semi-transparent image posted in the mixed image, and this image will always be overlaid on the mixed image. When the inputType field is set to TRTCMixInputTypePureAudio, the image is a placeholder image, and you need to specify userId . When the inputType field is set to TRTCMixInputTypeWatermark, the image is a watermark image, and you don't need to specify userId .Recommended value: default value: null, indicating not to set the placeholder or watermark image. Note TRTC's backend service will mix the image specified by the URL address into the final stream.URL link length is limited to 512 bytes. The image size is limited to 10MB.Support png, jpg, jpeg, bmp format. Take effects iff the inputType field is set to TRTCMixInputTypePureAudio or TRTCMixInputTypeWatermark. |
inputType | Field description: specify the mixed content of this stream (audio only, video only, audio and video, or watermark). Recommended value: default value: TRTCMixInputTypeUndefined. Note When specifying inputType as TRTCMixInputTypeUndefined and specifying pureAudio to YES, it is equivalent to setting inputType to TRTCMixInputTypePureAudio . When specifying inputType as TRTCMixInputTypeUndefined and specifying pureAudio to NO, it is equivalent to setting inputType to TRTCMixInputTypeAudioVideo . When specifying inputType as TRTCMixInputTypeWatermark, you don't need to specify the userId field, but you need to specify the image field. |
pureAudio | Field description: specify whether this stream mixes audio only Recommended value: default value: false Note this field has been disused. We recommend you use the new field inputType introduced in v8.5. |
rect | Field description: specify the coordinate area of this video image in px |
renderMode | Field description: specify the display mode of this stream. Recommended value: default value: 0. 0 is cropping, 1 is zooming, 2 is zooming and displaying black background. Note image doesn't support setting renderMode temporarily, the default display mode is forced stretch. |
roomId | Field description: ID of the room where this audio/video stream is located (an empty value indicates the local room ID) |
soundLevel | Field description: specify the target volumn level of On-Cloud MixTranscoding. (value range: 0-100) Recommended value: default value: 100. |
streamType | Field description: specify whether this video image is the primary stream image (TRTCVideoStreamTypeBig) or substream image (TRTCVideoStreamTypeSub). |
userId | Field description: user ID |
zOrder | Field description: specify the level of this video image (value range: 1–15; the value must be unique) |
EnumType | DESC |
appId | Field description: appId of Tencent Cloud CSSRecommended value: please click Application Management > Application Information in the TRTC console and get the appId in Relayed Live Streaming Info . |
audioBitrate | Field description: specify the target audio bitrate of On-Cloud MixTranscoding Recommended value: default value: 64 Kbps. Value range: [32,192]. |
audioChannels | Field description: specify the number of sound channels of On-Cloud MixTranscoding Recommended value: default value: 1, which means mono channel. Valid values: 1: mono channel; 2: dual channel. |
audioCodec | Field description: specify the audio encoding type of On-Cloud MixTranscoding Recommended value: default value: 0, which means LC-AAC. Valid values: 0: LC-AAC; 1: HE-AAC; 2: HE-AACv2. Note HE-AAC and HE-AACv2 only support [48000, 44100, 32000, 24000, 16000] sample rate. HE-AACv2 only support dual channel. HE-AAC and HE-AACv2 take effects iff the output streamId is specified. |
audioSampleRate | Field description: specify the target audio sample rate of On-Cloud MixTranscoding Recommended value: default value: 48000 Hz. Valid values: 12000 Hz, 16000 Hz, 22050 Hz, 24000 Hz, 32000 Hz, 44100 Hz, 48000 Hz. |
backgroundColor | Field description: specify the background color of the mixed video image. Recommended value: default value: 0x000000, which means black and is in the format of hex number; for example: "0x61B9F1" represents the RGB color (97,158,241). |
backgroundImage | Field description: specify the background image of the mixed video image. **Recommended value: default value: null, indicating not to set the background image. Note TRTC's backend service will mix the image specified by the URL address into the final stream.URL link length is limited to 512 bytes. The image size is limited to 10MB.Support png, jpg, jpeg, bmp format. |
bizId | Field description: bizId of Tencent Cloud CSSRecommended value: please click Application Management > Application Information in the TRTC console and get the bizId in Relayed Live Streaming Info . |
mixUsersArray | Field description: specify the position, size, layer, and stream type of each video image in On-Cloud MixTranscoding Recommended value: this field is an array in TRTCMixUser type, where each element represents the information of a video image. |
mixUsersArraySize | Field description: number of elements in the mixUsersArray array |
mode | Field description: layout mode Recommended value: please choose a value according to your business needs. The preset mode has better applicability. |
streamId | Field description: ID of the live stream output to CDN Recommended value: default value: null, that is, the audio/video streams in the room will be mixed into the audio/video stream of the caller of this API. If you don't set this parameter, the SDK will execute the default logic, that is, it will mix the multiple audio/video streams in the room into the audio/video stream of the caller of this API, i.e., A + B => A. If you set this parameter, the SDK will mix the audio/video streams in the room into the live stream you specify, i.e., A + B => C (C is the streamId you specify). |
videoBitrate | Field description: specify the target video bitrate (Kbps) of On-Cloud MixTranscoding Recommended value: if you enter 0, TRTC will estimate a reasonable bitrate value based on videoWidth and videoHeight . You can also refer to the recommended bitrate value in the video resolution enumeration definition (in the comment section). |
videoFramerate | Field description: specify the target video frame rate (fps) of On-Cloud MixTranscoding Recommended value: default value: 15 fps. Value range: (0,30]. |
videoGOP | Field description: specify the target video keyframe interval (GOP) of On-Cloud MixTranscoding Recommended value: default value: 2 (in seconds). Value range: [1,8]. |
videoHeight | Field description: specify the target resolution (height) of On-Cloud MixTranscoding Recommended value: 640 px. If you only mix audio streams, please set both width and height to 0; otherwise, there will be a black background in the live stream after mixtranscoding. |
videoSeiParams | Field description: SEI parameters. default value: null Note the parameter is passed in the form of a JSON string. Here is an example to use it: `json{ "payLoadContent":"xxx", "payloadType":5, "payloadUuid":"1234567890abcdef1234567890abcdef", "interval":1000, "followIdr":false } `The currently supported fields and their meanings are as follows: payloadContent: Required. The payload content of the passthrough SEI, which cannot be empty. payloadType: Required. The type of the SEI message, with a value range of 5 or an integer within the range of [100, 254] (excluding 244, which is an internally defined timestamp SEI). payloadUuid: Required when payloadType is 5, and ignored in other cases. The value must be a 32-digit hexadecimal number. interval: Optional, default is 1000. The sending interval of the SEI, in milliseconds. followIdr: Optional, default is false. When this value is true, the SEI will be ensured to be carried when sending a key frame, otherwise it is not guaranteed. |
videoWidth | Field description: specify the target resolution (width) of On-Cloud MixTranscoding Recommended value: 360 px. If you only mix audio streams, please set both width and height to 0; otherwise, there will be a black background in the live stream after mixtranscoding. |
EnumType | DESC |
appId | Field description: appId of Tencent Cloud CSSRecommended value: please click Application Management > Application Information in the TRTC console and get the appId in Relayed Live Streaming Info . |
bizId | Field description: bizId of Tencent Cloud CSSRecommended value: please click Application Management > Application Information in the TRTC console and get the bizId in Relayed Live Streaming Info . |
streamId | Field description: specify the push address (in RTMP format) of this audio/video stream at the third-party live streaming service provider Recommended value: default value: null,that is, the audio/video streams in the room will be pushed to the target service provider of the caller of this API. |
url | Field description: specify the push address (in RTMP format) of this audio/video stream at the third-party live streaming service provider Recommended value: the push URL rules vary greatly by service provider. Please enter a valid push URL according to the requirements of the target service provider. TRTC's backend server will push audio/video streams in the standard format to the third-party service provider according to the URL you enter. Note the push URL must be in RTMP format and meet the specifications of your target live streaming service provider; otherwise, the target service provider will reject the push requests from TRTC's backend service. |
EnumType | DESC |
filePath | Field description: storage path of the audio recording file, which is required. Note this path must be accurate to the file name and extension. The extension determines the format of the audio recording file. Currently, supported formats include PCM, WAV, and AAC. For example, if you specify the path as mypath/record/audio.aac , it means that you want the SDK to generate an audio recording file in AAC format.Please specify a valid path with read/write permissions; otherwise, the audio recording file cannot be generated. |
maxDurationPerFile | Field description: maxDurationPerFile is the max duration of each recorded file segments, in milliseconds, with a minimum value of 10000. The default value is 0, indicating no segmentation. |
recordingContent | Field description: Audio recording content type. Note: Record all local and remote audio by default. |
startLocalRecording
API is an enhanced version of the startAudioRecording
API. The former can record video files, while the latter can only record audio files.EnumType | DESC |
filePath | Field description: address of the recording file, which is required. Please ensure that the path is valid with read/write permissions; otherwise, the recording file cannot be generated. Note this path must be accurate to the file name and extension. The extension determines the format of the recording file. Currently, only the MP4 format is supported. For example, if you specify the path as mypath/record/test.mp4 , it means that you want the SDK to generate a local video file in MP4 format.Please specify a valid path with read/write permissions; otherwise, the recording file cannot be generated. |
interval | Field description: interval is the update frequency of the recording information in milliseconds. Value range: 1000–10000. Default value: -1, indicating not to call back |
maxDurationPerFile | Field description: maxDurationPerFile is the max duration of each recorded file segments, in milliseconds, with a minimum value of 10000. The default value is 0, indicating no segmentation. |
recordType | Field description: media recording type, which is TRTCRecordTypeBoth by default, indicating to record both audio and video. |
EnumType | DESC |
privateMapKey | Field description: permission credential used for permission control, which is optional. If you want only users with the specified userId values to enter a room, you need to use privateMapKey to restrict the permission.Recommended value: we recommend you use this parameter only if you have high security requirements. For more information, please see Enabling Advanced Permission Control. |
roomId | Field description: numeric room ID, which is optional. Users in the same room can see one another and make audio/video calls. Recommended value: value range: 1–4294967294. Note either roomId or strRoomId must be entered. If both are entered, roomId will be used. |
strRoomId | Field description: string-type room ID, which is optional. Users in the same room can see one another and make audio/video calls. Note either roomId or strRoomId must be entered. If both are entered, roomId will be used. |
userSig | Field description: user signature, which is optional. It is the authentication signature corresponding to the current userId and acts as the login password.If you don't specify the newly calculated userSig during room switch, the SDK will continue to use the userSig you specified during room entry (enterRoom).This requires you to ensure that the old userSig is still within the validity period allowed by the signature at the moment of room switch; otherwise, room switch will fail. |
EnumType | DESC |
channel | Field description: number of sound channels Recommended value: default value: 1, which means mono channel. Valid values: 1: mono channel; 2: dual channel. |
mode | Field description: audio callback data operation mode Recommended value: TRTCAudioFrameOperationModeReadOnly, get audio data from callback only. The modes that can be set are TRTCAudioFrameOperationModeReadOnly, TRTCAudioFrameOperationModeReadWrite. |
sampleRate | Field description: sample rate Recommended value: default value: 48000 Hz. Valid values: 16000, 32000, 44100, 48000. |
samplesPerCall | Field description: number of sample points Recommended value: the value must be an integer multiple of sampleRate/100. |
EnumType | DESC |
buffer | image content in BGRA format |
height | image height |
length | buffer size |
width | image width |
EnumType | DESC |
intRoomId | Value: Value range: 1-4294967294 Note: You cannot use both intRoomId and strRoomId . If you specify strRoomId , you need to set intRoomId to 0 . If you set both, only intRoomId will be used. |
strRoomId | Note: You cannot use both intRoomId and strRoomId . If you specify roomId , you need to leave strRoomId empty. If you set both, only intRoomId will be used.Value: 64 bytes or shorter; supports the following character set (89 characters): Uppercase and lowercase letters (a-z and A-Z) Numbers (0-9) Space, "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", "," |
userId | /Description: UTF-8-encoded user ID (required) Value: For example, if the ID of a user in your account system is "mike", set it to mike . |
EnumType | DESC |
isInternalLine | Description: Whether to publish to Tencent Cloud Value: The default value is true .Note: If the destination URL you set is provided by Tencent Cloud, set this parameter to true , and you will not be charged relaying fees. |
rtmpUrl | Description: The destination URL (RTMP) when you publish to Tencent Cloud or a third-party CDN. Value: The URLs of different CDN providers may vary greatly in format. Please enter a valid URL as required by your service provider. TRTC's backend server will push audio/video streams in the standard format to the URL you provide. Note: The URL must be in RTMP format. It must also meet the requirements of your service provider, or your service provider may reject push requests from the TRTC backend. |
EnumType | DESC |
cdnUrlList | Description: The destination URLs (RTMP) when you publish to Tencent Cloud or third-party CDNs. Note: You don’t need to set this parameter if you set the publishing mode to TRTCPublishMixStreamToRoom . |
cdnUrlListSize | Description: The length of the cdnUrlList array. Note: You don’t need to set this parameter if you set the publishing mode to TRTCPublishMixStreamToRoom . |
mixStreamIdentity | Description: The information of the robot that publishes the transcoded stream to a TRTC room. Note: You need to set this parameter only if you set the publishing mode to TRTCPublishMixStreamToRoom . Note: After you set this parameter, the stream will be pushed to the room you specify. We recommend you set it to a special user ID to distinguish the robot from the anchor who enters the room via the TRTC SDK. Note: Users whose streams are transcoded cannot subscribe to the transcoded stream. Note: If you set the subscription mode (@link setDefaultStreamRecvMode}) to manual before room entry, you need to manage the streams to receive by yourself (normally, if you receive the transcoded stream, you need to unsubscribe from the streams that are transcoded). Note: If you set the subscription mode (setDefaultStreamRecvMode) to auto before room entry, users whose streams are not transcoded will receive the transcoded stream automatically and will unsubscribe from the users whose streams are transcoded. You call muteRemoteVideoStream and muteRemoteAudio to unsubscribe from the transcoded stream. |
mode | Description: The publishing mode. Value: You can relay streams to a CDN, transcode streams, or publish streams to an RTC room. Select the mode that fits your needs.Note If you need to use more than one publishing mode, you can call startPublishMediaStream multiple times and set TRTCPublishTarget to a different value each time.You can use one mode each time you call the startPublishMediaStream) API. To modify the configuration, call updatePublishCDNStream. |
EnumType | DESC |
backgroundColor | Description: The background color of the mixed stream. Value: The value must be a hex number. For example, "0x61B9F1" represents the RGB color value (97,158,241). Default value: 0x000000 (black). |
fillMode | Description: The rendering mode. Value: The rendering mode may be fill (the image may be stretched or cropped) or fit (there may be black bars). Default value: TRTCVideoFillMode_Fill. |
fixedVideoStreamType | Description: Whether the video is the primary stream (TRTCVideoStreamTypeBig) or substream (e TRTCVideoStreamTypeSub). |
fixedVideoUser | Description: The users whose streams are transcoded.Note If you do not specify TRTCUser ( userId , intRoomId , strRoomId ), the TRTC backend will automatically mix the streams of anchors who are sending audio/video in the room according to the video layout you specify. |
placeHolderImage | Description: The URL of the placeholder image. If a user sends only audio, the image specified by the URL will be mixed during On-Cloud MixTranscoding. Value: This parameter is left empty by default, which means no placeholder image will be used.Note You need to specify the userId parameter in fixedVideoUser . The URL can be 512 bytes long at most, and the image must not exceed 2 MB. The image can be in PNG, JPG, JPEG, or BMP format. We recommend you use a semitransparent image in PNG format. |
rect | Description: The coordinates (in pixels) of the video. |
zOrder | Description: The layer of the video, which must be unique. Value range: 0-15. |
EnumType | DESC |
rect | Description: The coordinates (in pixels) of the watermark. |
watermarkUrl | Description: The URL of the watermark image. The image specified by the URL will be mixed during On-Cloud MixTranscoding.Note The URL can be 512 bytes long at most, and the image must not exceed 2 MB. The image can be in PNG, JPG, JPEG, or BMP format. We recommend you use a semitransparent image in PNG format. |
zOrder | Description: The layer of the watermark, which must be unique. Value range: 0-15. |
Note:
This parameter is required if you set the publishing mode to TRTCPublish_MixStream_ToCdn
or TRTCPublish_MixStream_ToRoom
in TRTCPublishTarget. Note:
If you use the relay to CDN feature (the publishing mode set to RTCPublish_BigStream_ToCdn
or TRTCPublish_SubStream_ToCdn
), to improve the relaying stability and playback compatibility, we also recommend you set this parameter.EnumType | DESC |
audioEncodedChannelNum | Description: The sound channels of the stream to publish. Value: Valid values: 1 (mono channel); 2 (dual-channel). Default: 1. |
audioEncodedCodecType | Description: The audio codec of the stream to publish. Value: Valid values: 0 (LC-AAC); 1 (HE-AAC); 2 (HE-AACv2). Default: 0.Note The audio sample rates supported by HE-AAC and HE-AACv2 are 48000, 44100, 32000, 24000, and 16000. When HE-AACv2 is used, the output stream can only be dual-channel. |
audioEncodedKbps | Description: The audio bitrate (Kbps) of the stream to publish. Value: Value range: [32,192]. Default: 50. |
audioEncodedSampleRate | Description: The audio sample rate of the stream to publish. Value: Valid values: [48000, 44100, 32000, 24000, 16000, 8000]. Default: 48000 (Hz). |
videoEncodedCodecType | Description: The video codec of the stream to publish. Value: Valid values: 0 (H264); 1 (H265). Default: 0. |
videoEncodedFPS | Description: The frame rate (fps) of the stream to publish. Value: Value range: (0,30]. Default: 20. |
videoEncodedGOP | Description: The keyframe interval (GOP) of the stream to publish. Value: Value range: [1,5]. Default: 3 (seconds). |
videoEncodedHeight | Description: The resolution (height) of the stream to publish. Value: Recommended value: 640. If you mix only audio streams, to avoid displaying a black video in the transcoded stream, set both width and height to 0 . |
videoEncodedKbps | Description: The video bitrate (Kbps) of the stream to publish. Value: If you set this parameter to 0 , TRTC will work out a bitrate based on videoWidth and videoHeight . For details, refer to the recommended bitrates for the constants of the resolution enum type (see comment). |
videoEncodedWidth | Description: The resolution (width) of the stream to publish. Value: Recommended value: 368. If you mix only audio streams, to avoid displaying a black video in the transcoded stream, set both width and height to 0 . |
videoSeiParams | Description: SEI parameters. Default: null Note: the parameter is passed in the form of a JSON string. Here is an example to use it:
The currently supported fields and their meanings are as follows: payloadContent: Required. The payload content of the passthrough SEI, which cannot be empty. payloadType: Required. The type of the SEI message, with a value range of 5 or an integer within the range of [100, 254] (excluding 244, which is an internally defined timestamp SEI). payloadUuid: Required when payloadType is 5, and ignored in other cases. The value must be a 32-digit hexadecimal number. interval: Optional, default is 1000. The sending interval of the SEI, in milliseconds. followIdr: Optional, default is false. When this value is true, the SEI will be ensured to be carried when sending a key frame, otherwise it is not guaranteed. |
EnumType | DESC |
audioMixUserList | Description: The information of each audio stream to mix. Value: This parameter is an array. Each TRTCUser element in the array indicates the information of an audio stream.Note If you do not specify this array, the TRTC backend will automatically mix all streams of the anchors who are sending audio in the room according to the audio encode param TRTCStreamEncoderParam you specify (currently only supports up to 16 audio and video inputs). |
audioMixUserListSize | Description: The length of the audioMixUserList array. |
backgroundColor | Description: The background color of the mixed stream. Value: The value must be a hex number. For example, "0x61B9F1" represents the RGB color value (97,158,241). Default value: 0x000000 (black). |
backgroundImage | Description: The URL of the background image of the mixed stream. The image specified by the URL will be mixed during On-Cloud MixTranscoding. Value: This parameter is left empty by default, which means no background image will be used.Note The URL can be 512 bytes long at most, and the image must not exceed 2 MB. The image can be in PNG, JPG, JPEG, or BMP format. We recommend you use a semitransparent image in PNG format. |
videoLayoutList | Description: The position, size, layer, and stream type of each video in On-Cloud MixTranscoding. Value: This parameter is an array. Each TRTCVideoLayout element in the array indicates the information of a video in On-Cloud MixTranscoding. |
videoLayoutListSize | Description: The length of the videoLayoutList array. |
watermarkList | Description: The position, size, and layer of each watermark image in On-Cloud MixTranscoding. Value: This parameter is an array. Each TRTCWatermark element in the array indicates the information of a watermark. |
watermarkListSize | Description: The length of the watermarkList array. |
EnumType | DESC |
encryptionAlgorithm | Description: Encryption algorithm, the default is TRTCEncryptionAlgorithmAes128Gcm. |
encryptionKey | Description: encryption key, string type. Value: If the encryption algorithm is TRTCEncryptionAlgorithmAes128Gcm, the key length must be 16 bytes;if the encryption algorithm is TRTCEncryptionAlgorithmAes256Gcm, the key length must be 32 bytes. |
encryptionSalt[32] | Description: Salt, initialization vector for encryption. Value: It is necessary to ensure that the array filled in this parameter is not empty, not all 0 and the data length is 32 bytes. |
EnumType | DESC |
enablePitchCalculation | Description: Whether to enable local vocal frequency calculation. |
enableSpectrumCalculation | Description: Whether to enable sound spectrum calculation. |
enableVadDetection | Description: Whether to enable local voice detection.Note Call before startLocalAudio. |
interval | Description: Set the trigger interval of the onUserVoiceVolume callback, the unit is milliseconds, the minimum interval is 100ms, if it is less than or equal to 0, the callback will be closed. Value: Recommended value: 300, in milliseconds.Note When the interval is greater than 0, the volume prompt will be enabled by default, no additional setting is required. |
Was this page helpful?