tencent_rtc_sdk. This document covers the enums, parameter classes and statistics classes used by the APIs, which are available after importing package:tencent_rtc_sdk/trtc_cloud_def.dart.Type | Description |
Application scenario. | |
User role. | |
Room entry parameters. | |
Room switching parameters. |
Type | Description |
Video resolution. | |
Video aspect ratio mode. | |
Video stream type. | |
Video fill mode. | |
Video rotation direction. | |
Video mirror type. | |
Video quality preference. | |
G-sensor adaptation mode (mobile only). | |
Video encoding parameters. | |
Network bandwidth limit parameters. | |
Video rendering parameters. |
Type | Description |
Audio quality. | |
Audio recording content type. | |
Audio callback data operation mode. | |
Audio frame content format. | |
Volume evaluation parameters. | |
Format parameters of custom audio callback. | |
Volume. |
Type | Description |
Beauty (skin smoothing) algorithm. | |
Source type of the watermark image. |
Type | Description |
Screen sharing target type (desktop only). | |
Screen sharing target information (desktop only). | |
Screen/window list. | |
Advanced control parameters of screen sharing. | |
Storage structure of window thumbnails and icons. |
Type | Description |
Media stream publishing mode. | |
Information of users participating in publishing. | |
Target address of CDN relaying. | |
Target configuration of media stream publishing. | |
Layout of each video in the transcoded stream. | |
Layout of watermarks in the transcoded stream. | |
Encoding output parameters of media streams. | |
Cloud stream mixing configuration parameters. |
Type | Description |
Data source of local video screenshot. | |
Local media recording type. | |
Local media recording parameters. |
Type | Description |
Network quality. | |
Audio/Video playback status. | |
Reason for playback status change. | |
Network speed test scenario. | |
Network quality information. | |
Local audio/video statistics. | |
Remote audio/video statistics. | |
Summary statistics of network and performance. | |
Network speed test parameters. | |
Network speed test result. |
Type | Description |
Video pixel format. | |
Video data transfer method. | |
Video texture data. | |
Video frame information. | |
Audio frame data. |
Type | Description |
Log level. | |
Rectangle coordinates. | |
Size (width and height). |
live (audio + video) and voiceChatRoom (audio only). Users in these scenarios are divided into "anchors" and "audience members". A single room supports up to 100,000 concurrent online users, suitable for live streaming to a large audience.videoCall (audio + video) and audioCall (audio only). Users in these scenarios have no role distinction, but a single room supports up to 300 concurrent online users, suitable for small-scale real-time communication.Enum Value | Value | Description |
videoCall | 0 | Video call scenario, supporting 720p and 1080p HD quality. A single room supports up to 300 concurrent online users, of whom up to 50 can speak at the same time. Applicable scenarios: one-to-one video calls, video conferences with up to 300 participants, online medical consultation, video chat, video interviews, etc. |
live | 1 | Interactive video live streaming scenario, supporting smooth mic on/off without waiting for switching, with anchor latency as low as under 300 ms. It supports up to 100,000 concurrent viewers with playback latency as low as 1000 ms. Applicable scenarios: low-latency video live streaming, interactive classrooms with up to 100,000 participants, live video PK, video dating rooms, remote training, large conferences, etc. Note: |
audioCall | 2 | Audio call scenario, supporting 48 kHz stereo audio calls. A single room supports up to 300 concurrent online users, of whom up to 50 can speak at the same time. Applicable scenarios: one-to-one audio calls, audio conferences with up to 300 participants, voice chat, voice-based Werewolf games, etc. |
voiceChatRoom | 3 | Interactive audio live streaming scenario, supporting smooth mic on/off without waiting for switching, with anchor latency as low as under 300 ms. It supports up to 100,000 concurrent listeners with playback latency as low as 1000 ms. Applicable scenarios: low-latency audio live streaming, voice chat rooms, karaoke rooms, FM radio, etc. Note: |
Enum Value | Value | Description |
anchor | 20 | Anchor, who can publish their own audio/video streams. Up to 50 users in a room can publish at the same time. |
audience | 21 | Audience, who can only listen to or watch the audio/video streams of anchors in the room. To publish their own streams, they need to switch to the "anchor" role via switchRole first. A single room supports up to 100,000 concurrent audience members. |
roomId or strRoomId.roomId and strRoomId.roomId and strRoomId, because they are not interconnected. For example, the number 123 and the string 123 are two completely different rooms in TRTC.Field | Type | Default Value | Description |
sdkAppId | int | 0 | Application ID (required). Tencent Cloud bills based on this field. After creating an application, you can get this ID on the account information page of the TRTC console. |
userId | String | '' | User ID (required). It is the UTF-8 encoded ID of the local user, equivalent to the username. For example, if the ID of a user in your account system is mike, this field can be set to mike. |
userSig | String | '' | User signature (required). It is the authentication signature corresponding to the current userId, equivalent to the password for logging in to Tencent Cloud services. |
roomId | int | 0 | Numeric room ID. Users in the same room can see each other and make audio/video calls. Value range: 1 - 4294967294. Note: roomId and strRoomId are mutually exclusive. If you use strRoomId, set roomId to 0. If both are specified, roomId takes effect. |
strRoomId | String | '' | String room ID. Users in the same room can see each other and make audio/video calls. The length limit is 64 bytes. The following 89 characters are supported: letters (a-z, A-Z), digits (0-9), space, !, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _, {, }, |, ~, ,.Note: Either roomId or strRoomId must be specified. When interconnecting with the same sdkAppId, be sure to use the same room ID type. |
role | TRTCRoleType.anchor | User role in live streaming scenarios, which the SDK uses to determine whether the user is an anchor or audience member. For details, see TRTCRoleType. Note: This field applies only to live streaming scenarios (TRTCAppScene.live or TRTCAppScene.voiceChatRoom) and does not take effect in call scenarios. | |
streamId | String | '' | Bound Tencent Cloud CSS CDN stream ID (optional). After this field is set, the user's audio/video stream can be played on the Tencent Cloud CSS CDN via standard live streaming solutions (FLV or HLS). This parameter can be up to 64 bytes and can be left empty. It is recommended to use sdkappid_roomid_userid_main as the streamId, which is easier to identify and will not cause conflicts among your multiple applications.Note: To use the Tencent Cloud CSS CDN, you need to enable relayed live streaming on the "Feature Configuration" page of the console first. |
userDefineRecordId | String | '' | Cloud recording switch (optional), used to specify whether to record the user's audio/video stream in the cloud as a file in the specified format. Up to 64 bytes. Only letters (a-z, A-Z), digits (0-9), underscores and hyphens are supported. |
privateMapKey | String | '' | Room signature (optional). If you want only users with specified userIds to enter the room, use this field to restrict permissions.It is recommended only for scenarios with high security requirements. For details, see Enabling Advanced Permission Control. |
businessInfo | String | '' | Business data (optional), used only for some uncommon special requirements. It is recommended not to use this field. |
Field | Type | Default Value | Description |
userSig | String | Required | User signature (required). It is the authentication signature corresponding to the current userId, equivalent to the password for logging in to Tencent Cloud services. |
roomId | int | 0 | Numeric room ID. Users in the same room can see each other and make audio/video calls. Value range: 1 - 4294967294. Note: roomId and strRoomId are mutually exclusive. If you use strRoomId, set roomId to 0. If both are specified, roomId takes effect. |
strRoomId | String | '' | String room ID. Users in the same room can see each other and make audio/video calls. The length limit is 64 bytes. Note: Either roomId or strRoomId must be specified. When interconnecting with the same sdkAppId, be sure to use the same room ID type. |
privateMapKey | String | '' | Room signature (optional). If you want only users with specified userIds to enter the room, use this field to restrict permissions.It is recommended only for scenarios with high security requirements. For details, see Enabling Advanced Permission Control. |
portrait.Enum Value | Value | Description |
res_120_120 | 1 | Aspect ratio 1:1; resolution 120x120; recommended bitrate (call) 80 Kbps; recommended bitrate (live streaming) 120 Kbps. |
res_160_160 | 3 | Aspect ratio 1:1; resolution 160x160; recommended bitrate (call) 100 Kbps; recommended bitrate (live streaming) 150 Kbps. |
res_270_270 | 5 | Aspect ratio 1:1; resolution 270x270; recommended bitrate (call) 200 Kbps; recommended bitrate (live streaming) 300 Kbps. |
res_480_480 | 7 | Aspect ratio 1:1; resolution 480x480; recommended bitrate (call) 350 Kbps; recommended bitrate (live streaming) 500 Kbps. |
res_160_120 | 50 | Aspect ratio 4:3; resolution 160x120; recommended bitrate (call) 100 Kbps; recommended bitrate (live streaming) 150 Kbps. |
res_240_180 | 52 | Aspect ratio 4:3; resolution 240x180; recommended bitrate (call) 150 Kbps; recommended bitrate (live streaming) 250 Kbps. |
res_280_210 | 54 | Aspect ratio 4:3; resolution 280x210; recommended bitrate (call) 200 Kbps; recommended bitrate (live streaming) 300 Kbps. |
res_320_240 | 56 | Aspect ratio 4:3; resolution 320x240; recommended bitrate (call) 250 Kbps; recommended bitrate (live streaming) 375 Kbps. |
res_400_300 | 58 | Aspect ratio 4:3; resolution 400x300; recommended bitrate (call) 300 Kbps; recommended bitrate (live streaming) 450 Kbps. |
res_480_360 | 60 | Aspect ratio 4:3; resolution 480x360; recommended bitrate (call) 400 Kbps; recommended bitrate (live streaming) 600 Kbps. |
res_640_480 | 62 | Aspect ratio 4:3; resolution 640x480; recommended bitrate (call) 600 Kbps; recommended bitrate (live streaming) 900 Kbps. |
res_960_720 | 64 | Aspect ratio 4:3; resolution 960x720; recommended bitrate (call) 1000 Kbps; recommended bitrate (live streaming) 1500 Kbps. |
res_160_90 | 100 | Aspect ratio 16:9; resolution 160x90; recommended bitrate (call) 150 Kbps; recommended bitrate (live streaming) 250 Kbps. |
res_256_144 | 102 | Aspect ratio 16:9; resolution 256x144; recommended bitrate (call) 200 Kbps; recommended bitrate (live streaming) 300 Kbps. |
res_320_180 | 104 | Aspect ratio 16:9; resolution 320x180; recommended bitrate (call) 250 Kbps; recommended bitrate (live streaming) 400 Kbps. |
res_480_270 | 106 | Aspect ratio 16:9; resolution 480x270; recommended bitrate (call) 350 Kbps; recommended bitrate (live streaming) 550 Kbps. |
res_640_360 | 108 | Aspect ratio 16:9; resolution 640x360; recommended bitrate (call) 500 Kbps; recommended bitrate (live streaming) 900 Kbps. |
res_960_540 | 110 | Aspect ratio 16:9; resolution 960x540; recommended bitrate (call) 850 Kbps; recommended bitrate (live streaming) 1300 Kbps. |
res_1280_720 | 112 | Aspect ratio 16:9; resolution 1280x720; recommended bitrate (call) 1200 Kbps; recommended bitrate (live streaming) 1800 Kbps. |
res_1920_1080 | 114 | Aspect ratio 16:9; resolution 1920x1080; recommended bitrate (call) 2000 Kbps; recommended bitrate (live streaming) 3000 Kbps. |
Enum Value | Value | Description |
landscape | 0 | Landscape resolution. |
portrait | 1 | Portrait resolution. |
Enum Value | Value | Description |
big | 0 | HD big image, generally used to transmit camera video data. |
small | 1 | LD small image, with the same content as the big image but a lower resolution and bitrate, and therefore lower definition. |
sub | 2 | Substream image, generally used for screen sharing. Only one user in a room is allowed to publish the substream video at a time. Other users must wait until that user disables the substream before publishing their own. |
Enum Value | Value | Description |
fill | 0 | Fill mode. The video is scaled proportionally and centered to fill the entire display area, and the parts beyond the display area are cropped. In this mode, the video may not be displayed completely. |
fit | 1 | Fit mode. The video is scaled proportionally by its long side to fit the display area, and the remaining area on the short side is filled with black. In this mode, the video is displayed completely, but there may be black bars. |
scaleFill | 2 | Stretch mode. The video is directly stretched or compressed to completely fill the display area regardless of its aspect ratio. In this mode, the aspect ratio of the video may be changed, causing the rendered video to be distorted. |
Enum Value | Value | Description |
rotation0 | 0 | No rotation. |
rotation90 | 1 | Rotate 90 degrees clockwise. |
rotation180 | 2 | Rotate 180 degrees clockwise. |
rotation270 | 3 | Rotate 270 degrees clockwise. |
Enum Value | Value | Description |
auto | 0 | Auto mode: Mirror the front camera image but not the rear camera image (mobile only). |
enable | 1 | Mirror both front and rear camera images. |
disable | 2 | Mirror neither front nor rear camera images. |
Enum Value | Value | Description |
smooth | 1 | Smoothness first. When the current network cannot transmit clear and smooth video at the same time, smoothness is prioritized at the cost of blurrier images. |
clear | 2 | Clarity first (default). When the current network cannot transmit clear and smooth video at the same time, clarity is prioritized at the cost of more stuttering. |
Enum Value | Value | Description |
disable | 0 | Does not adapt to the G-sensor direction. This is the default value on desktop. In this mode, the video published by the current user is not affected by changes in the G-sensor direction. |
uiAutoLayout | 1 | Adapts to the G-sensor direction. This is the default value on mobile. In this mode, the video published by the current user is adjusted according to the G-sensor direction, while the orientation of the local preview remains unchanged. When the phone or tablet is upside down, the SDK automatically rotates the published video by 180 degrees to ensure that remote users see the video in the correct orientation. If your application has already enabled G-sensor adaptation at the UI layer, the uiFixLayout mode is recommended. |
uiFixLayout | 2 | Adapts to the G-sensor direction. In this mode, the video published by the current user is adjusted according to the G-sensor direction, and the local preview also rotates accordingly. When the phone or tablet is upside down, the SDK automatically rotates the published video by 180 degrees to ensure that remote users see the video in the correct orientation. |
Field | Type | Default Value | Description |
videoResolution | TRTCVideoResolution.res_1280_720 | For video calls, a resolution of 360x640 or lower with videoResolutionMode set to portrait is recommended; for mobile live streaming, 540x960 + portrait is recommended; for Windows and macOS, 640x360 or higher + landscape is recommended. | |
videoResolutionMode | TRTCVideoResolutionMode.portrait | If videoResolution is 640x360 and this field is portrait, the final encoded output resolution is 360x640. | |
videoFps | int | 10 | Video capture frame rate. 15 fps or 20 fps is recommended. Below 5 fps, stuttering is obvious; above 20 fps, resources are wasted (movies usually run at 24 fps). Note: The front cameras of many Android phones do not support capture frame rates higher than 15 fps. |
videoBitrate | int | 1600 | Target video bitrate. The SDK encodes at this bitrate and actively lowers it only when the network is poor. For recommended values, see the optimal bitrate of each tier in TRTCVideoResolution. You can also set it slightly higher. |
minVideoBitrate | int | 0 | Minimum video bitrate. The SDK lowers the bitrate to this value only when the network is poor. 0 means the SDK automatically determines the minimum bitrate based on the resolution.For "clarity first", it can be set to 60% of videoBitrate; for "smoothness first", it can be set to 200 Kbps; if it is the same as videoBitrate, the SDK's adaptive adjustment is effectively disabled. |
enableAdjustRes | bool | false | Whether to allow dynamic resolution adjustment. false is recommended for mobile live streaming; for video calls where smoothness matters more, true is recommended (takes effect only for TRTCVideoStreamType.big).Note: If recording is required, make sure that resolution changes will not affect the recording after enabling this. |
Field | Type | Default Value | Description |
preference | TRTCVideoQosPreference.clear | Whether to prioritize "clarity" or "smoothness" under weak networks. For details, see TRTCVideoQosPreference. Smoothness first: The image may be blurry, but stays smooth without stuttering. Clarity first: The image is as clear as possible, but stuttering is more likely. |
Field | Type | Default Value | Description |
rotation | TRTCVideoRotation.rotation0 | ||
fillMode | TRTCVideoFillMode.fill | ||
mirrorType | TRTCVideoMirrorType.auto |
Enum Value | Value | Description |
speech | 1 | Smooth: Sample rate 16 kHz; mono; bitrate 16 Kbps. This mode has the strongest resistance to packet loss and is suitable for audio call scenarios such as online meetings and voice calls. |
defaultMode | 2 | Default: Sample rate 48 kHz; mono; bitrate 50 Kbps. This mode is between smooth mode and high-quality mode. It is the default mode of the SDK and is recommended. |
music | 3 | High quality: Sample rate 48 kHz; stereo + full band; bitrate 128 Kbps. Suitable for scenarios requiring high-fidelity music transmission, such as online karaoke and music live streaming. |
Enum Value | Value | Description |
all | 0 | Record all local and remote audio. |
local | 1 | Record only local audio. |
remote | 2 | Record only remote audio. |
Enum Value | Value | Description |
readWrite | 0 | Read-write mode: The callback audio data can be obtained and modified. This is the default mode. |
readOnly | 1 | Read-only mode: Audio data is only obtained from the callback. |
Enum Value | Value | Description |
none | 0 | None. |
pcm | 1 | Audio data in PCM format. |
Field | Type | Default Value | Description |
enablePitchCalculation | bool | false | Whether to enable local voice pitch calculation. |
enableSpectrumCalculation | bool | false | Whether to enable sound spectrum calculation. |
enableVadDetection | bool | false | Whether to enable local voice detection. Note: |
interval | int | 300 | Trigger interval of the onUserVoiceVolume callback, in milliseconds. The minimum interval is 100 ms. If it is less than or equal to 0, the callback is disabled. Recommended value: 300. When this value is greater than 0, volume reminder is enabled by default without additional settings. |
Field | Type | Default Value | Description |
sampleRate | int | 0 | Sample rate. Default value: 48000 Hz. Valid values: 16000, 32000, 44100, 48000. |
channel | int | 0 | Number of channels. Default value: 1 (mono). Valid values: 1 (mono), 2 (stereo). |
samplesPerCall | int | 0 | Number of sample points, which must be an integer multiple of sampleRate / 100. |
mode | TRTCAudioFrameOperationMode.readWrite |
Field | Type | Default Value | Description |
userId | String | '' | User ID of the speaker. Empty indicates the local user. |
volume | int | -1 | Volume of the speaker. Value range: 0 - 100. |
vad | int | -1 | Voice detection result of the local user. 0: Not human voice.1: Human voice. |
pitch | double | -1 | Voice pitch of the local user, in Hz. Value range: [0, 4000]. For remote users, this value is always 0. |
spectrumData | List<double>? | — | Audio spectrum data. The sound frequency is divided into 256 frequency bands, and this field records the energy value of each band. Each energy value ranges from -300 to 0, in dBFS. |
Enum Value | Value | Description |
smooth | 0 | Smooth style. A more aggressive algorithm with more obvious skin smoothing effects, suitable for showroom live streaming. |
nature | 1 | Nature style. The algorithm retains more facial details with more natural skin smoothing effects, suitable for most live streaming scenarios. |
Enum Value | Value | Description |
file | 0 | Image file path. The BMP, GIF, JPEG, PNG, TIFF, Exif, WMF and EMF formats are supported. |
bgra32 | 1 | Memory block in BGRA32 format. |
rgba32 | 2 | Memory block in RGBA32 format. |
Enum Value | Value | Description |
unknown | -1 | Undefined. |
window | 0 | The sharing target is the window of an application. |
screen | 1 | The sharing target is the entire screen. |
custom | 2 | The sharing target is a user-defined data source. |
Field | Type | Default Value | Description |
type | TRTCScreenCaptureSourceType.unknown | Capture source type (whether to share the entire screen or a window). For details, see TRTCScreenCaptureSourceType. | |
viewId | int | 0 | ID of the capture source. For a window, this field indicates the window ID; for a screen, it indicates the display ID. |
sourceName | String | '' | Name of the capture source (UTF-8 encoded). |
thumbBGRA | - | ||
iconBGRA | - | ||
isMinimizeWindow | bool | false | Whether the window is minimized. |
isMainScreen | bool | false | Whether it is the primary display (applicable to multi-display scenarios). |
x | int | 0 | X coordinate of the screen or window, in pixels. |
y | int | 0 | Y coordinate of the screen or window, in pixels. |
width | int | 0 | Width of the screen or window, in pixels. |
height | int | 0 | Height of the screen or window, in pixels. |
Field | Type | Default Value | Description |
count | int | 0 | Number of windows. |
sourceList | List<TRTCScreenCaptureSourceInfo> | - |
Field | Type | Default Value | Description |
enableCaptureMouse | bool | true | Whether to capture the mouse while capturing the target content. |
enableHighLight | bool | true | Whether to highlight the window being shared (draw a border around the sharing target). |
enableHighPerformance | bool | true | Whether to enable high-performance mode (takes effect only when sharing the screen). When enabled, screen capture performance is optimal, but the anti-occlusion capability is lost. If both enableHighLight and enableHighPerformance are enabled, remote users will see the highlighted border. |
highLightColor | int | 0 | Color of the highlight border, in RGB format. If 0 is passed in, the default color #FFE640 is used. |
highLightWidth | int | 0 | Width of the highlight border. If 0 is passed in, the default stroke width of 5 px is used. The maximum value is 50. |
enableCaptureChildWindow | bool | false | Whether to capture child windows when capturing a window (the child windows must have the Owner or Popup property relative to the captured window). |
Field | Type | Default Value | Description |
buffer | Uint8List? | - | Image content in BGRA format. |
length | int | 0 | Buffer size. |
width | int | 0 | Image width. |
height | int | 0 | Image height. |
Enum Value | Value | Description |
unknown | 0 | Undefined. |
bigStreamToCdn | 1 | Publishes the primary stream (TRTCVideoStreamType.big) in the room to Tencent Cloud or a third-party CDN (only RTMP is supported). |
subStreamToCdn | 2 | Publishes the substream (TRTCVideoStreamType.sub) in the room to Tencent Cloud or a third-party CDN (only RTMP is supported). |
mixStreamToCdn | 3 | Together with the encoding parameters TRTCStreamEncoderParam and stream mixing parameters TRTCStreamMixingConfig, transcodes the specified streams and publishes them to Tencent Cloud or a third-party CDN (only RTMP is supported). |
mixStreamToRoom | 4 | Together with the encoding parameters TRTCStreamEncoderParam and stream mixing parameters TRTCStreamMixingConfig, transcodes the specified streams and publishes them to the room you specify. You need to specify the robot that publishes the transcoded stream to the TRTC room via TRTCUser in TRTCPublishTarget. |
Field | Type | Default Value | Description |
userId | String | '' | UTF-8 encoded user ID (required). For example, if the ID of a user in your account system is mike, set it to mike. |
intRoomId | int | 0 | Numeric room ID. The room ID type must be consistent with that in TRTCParams. Value range: 1 - 4294967294. Note: intRoomId and strRoomId cannot be used at the same time. If you use strRoomId, set intRoomId to 0. If both are specified, only intRoomId takes effect. |
strRoomId | String | '' | String room ID. The room ID type must be consistent with that in TRTCParams. The length limit is 64 bytes. Note: intRoomId and strRoomId cannot be used at the same time. If you use intRoomId, leave strRoomId empty. If both are specified, only intRoomId takes effect. |
Field | Type | Default Value | Description |
rtmpUrl | String | '' | Target address (RTMP) for publishing to Tencent Cloud or a third-party CDN. Address formats vary greatly among CDN providers. Fill in a valid address according to the provider's requirements, and the TRTC backend service will push audio/video streams in a standard format to the address. Note: The address must be in RTMP format and meet the provider's requirements; otherwise, the provider may reject the push request from the TRTC backend. |
isInternalLine | bool | true | Whether to publish to Tencent Cloud. If the target address is provided by Tencent Cloud, set this parameter to true. In this case, no relay fees are incurred. |
Field | Type | Default Value | Description |
mode | TRTCPublishMode.unknown | Note: To use multiple publishing modes, you can call startPublishMediaStream multiple times, passing in a different TRTCPublishTarget each time; each call can use only one mode. To modify the configuration, call updatePublishMediaStream. | |
cdnUrlList | List<TRTCPublishCdnUrl> | - | List of target addresses (RTMP) for publishing to Tencent Cloud or third-party CDNs. For details, see TRTCPublishCdnUrl. Note: This field does not need to be set when the publishing mode is mixStreamToRoom. |
mixStreamIdentity | - | Information of the robot that publishes the transcoded stream to the TRTC room. For details, see TRTCUser. Note: Needs to be set only when the publishing mode is mixStreamToRoom. It is recommended to set it to a special user ID to distinguish it from anchors who enter the room via the SDK. Users participating in transcoding cannot subscribe to this transcoded stream. |
Field | Type | Default Value | Description |
rect | - | ||
zOrder | int | 0 | Layer of the image, which must be unique. Value range: 0 - 15. |
fillMode | TRTCVideoFillMode.fill | ||
backgroundColor | int | 0 | Background color of the mixed stream. The value must be a hexadecimal number. For example, 0x61B9F1 represents the RGB color (97,158,241). Default value: 0x000000 (black). |
placeHolderImage | Uint8List | - | Placeholder image. If a user sends only audio, this image is mixed in during on-cloud stream mixing. Empty by default, which means no placeholder image is used. Note: You need to specify userId in fixedVideoUser. The image cannot exceed 2 MB. The PNG, JPG, JPEG and BMP formats are supported, and semi-transparent PNG images are recommended. |
fixedVideoUser | - | Note: If userId, intRoomId and strRoomId are not specified, the TRTC backend automatically mixes the streams of anchors who are sending audio/video in the room according to the layout you specify. | |
fixedVideoStreamType | TRTCVideoStreamType.big | Whether the image is the primary stream ( big) or the substream (sub). For details, see TRTCVideoStreamType. |
Field | Type | Default Value | Description |
watermarkUrl | String | '' | Address of the watermark image, which is mixed in during on-cloud stream mixing. Note: The address can be up to 512 bytes, and the image cannot exceed 2 MB. The PNG, JPG, JPEG and BMP formats are supported, and semi-transparent PNG images are recommended. |
rect | - | ||
zOrder | int | 0 | Layer of the watermark, which must be unique. Value range: 0 - 15. |
Field | Type | Default Value | Description |
videoEncodedWidth | int | 0 | Video width of the published stream. Recommended value: 368. If only audio streams are mixed, set both width and height to 0 to avoid a black image in the transcoded stream. |
videoEncodedHeight | int | 0 | Video height of the published stream. Recommended value: 640. If only audio streams are mixed, set both width and height to 0 to avoid a black image in the transcoded stream. |
videoEncodedFPS | int | 0 | Video frame rate of the published stream. Value range: (0, 30]. Default value: 20. |
videoEncodedGOP | int | 0 | Keyframe interval (GOP) of the published stream. Value range: [1, 5]. Default value: 3. Unit: seconds. |
videoEncodedKbps | int | 0 | Video bitrate of the published stream, in Kbps. If set to 0, TRTC automatically calculates an appropriate bitrate based on the width and height. |
audioEncodedSampleRate | int | 0 | Audio sample rate of the published stream. Valid values: 48000, 44100, 32000, 24000, 16000, 8000. Default value: 48000. Unit: Hz. |
audioEncodedChannelNum | int | 0 | Number of audio channels of the published stream. Valid values: 1 (mono); 2 (stereo); Default value: 1. |
audioEncodedKbps | int | 0 | Audio bitrate of the published stream. Value range: [32, 192]. Default value: 50. Unit: Kbps. |
audioEncodedCodecType | int | 0 | Audio codec of the published stream. Valid values: 0 (LC-AAC); 1 (HE-AAC); 2 (HE-AACv2); Default value: 0. Note: The 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 stereo. |
videoEncodedCodecType | int | 0 | Video codec of the published stream. Valid values: 0 (H264); 1 (H265); Default value: 0. |
videoSeiParams | String | '' | SEI parameters, passed in as a JSON string. Empty by default. Supported fields: payloadContent (required, the payload content of the pass-through SEI);payloadType (required, 5 or an integer in [100, 254] excluding 244);payloadUuid (required when payloadType is 5, must be a 32-digit hexadecimal number);interval (optional, SEI sending interval in milliseconds, 1000 by default);followIdr (optional, false by default; when true, SEI is guaranteed to be carried when keyframes are sent). |
Field | Type | Default Value | Description |
backgroundColor | int | 0 | Background color of the mixed stream. The value must be a hexadecimal number. For example, 0x61B9F1 represents the RGB color (97,158,241). Default value: 0x000000 (black). |
backgroundImage | Uint8List | - | Background image of the mixed stream, which is mixed in during on-cloud stream mixing. Empty by default, which means no background image is used. Note: The address can be up to 512 bytes, and the image cannot exceed 2 MB. The PNG, JPG, JPEG and BMP formats are supported, and semi-transparent PNG images are recommended. |
videoLayoutList | List<TRTCVideoLayout> | - | Position, size, layer and stream type of each video in on-cloud stream mixing. For details, see TRTCVideoLayout. |
audioMixUserList | List<TRTCUser> | - | Note: If this array is not specified, the TRTC backend automatically mixes the streams of anchors who are sending audio in the room based on the TRTCStreamEncoderParam you set (up to 16 audio/video inputs are currently supported). |
watermarkList | List<TRTCWatermark> | - | Position, size and layer of each watermark image in on-cloud stream mixing. For details, see TRTCWatermark. |
Enum Value | Value | Description |
stream | 0 | The SDK captures the native video content from the video stream. The captured image is not affected by the display control of the rendering control. |
view | 1 | The SDK captures the displayed video content from the rendering control, achieving WYSIWYG. However, if the display area is too small, the captured image will also be small. |
capture | 2 | The SDK captures the captured video content from the capture control, which yields clearer images. |
Enum Value | Value | Description |
audio | 0 | Record audio only. |
video | 1 | Record video only. |
both | 2 | Record both audio and video. |
Field | Type | Default Value | Description |
filePath | String | '' | Address of the recording file (required). Make sure the path is valid and has read/write permissions; otherwise, the recording file cannot be generated. Note: The path must include the file name and extension. The extension determines the format of the recording file, and only MP4 is currently supported. For example, specifying the path mypath/record/test.mp4 means you want the SDK to generate a local video file in MP4 format. |
recordType | TRTCLocalRecordType.both | Media recording type. Both audio and video are recorded by default. For details, see TRTCLocalRecordType. | |
interval | int | -1 | Update frequency of recording information, in milliseconds. Value range: 1000 - 10000. The default value -1 means no callback. |
maxDurationPerFile | int | 0 | Maximum duration of each recording file segment, in milliseconds. The minimum value is 10000. The default value 0 means no segmentation. |
excellent is the best and down is the worst.Enum Value | Value | Description |
unknown | 0 | Undefined. |
excellent | 1 | The current network is excellent. |
good | 2 | The current network is good. |
poor | 3 | The current network is fair. |
bad | 4 | The current network is poor. |
vBad | 5 | The current network is very poor. |
down | 6 | The current network does not meet the minimum requirements of TRTC. |
Enum Value | Value | Description |
stopped | 0 | Playback stopped. |
playing | 1 | Playing. |
loading | 2 | Loading. |
Enum Value | Value | Description |
internal | 0 | Default value. |
bufferingBegin | 1 | The stream enters the loading state due to network congestion. |
bufferingEnd | 2 | The stream enters the playing state after the network recovers. |
localStarted | 3 | The stream enters the playing state because a playback-related API was called locally. |
localStopped | 4 | The stream enters the stopped state because a stop-related API was called locally. |
remoteStarted | 5 | The stream enters the loading or playing state because the remote user started (or resumed) publishing audio/video streams. |
remoteStopped | 6 | The stream enters the stopped state because the remote user stopped (or paused) publishing audio/video streams. |
Enum Value | Value | Description |
delayTesting | 1 | Latency test. |
delayAndBandwidthTesting | 2 | Latency and bandwidth test. |
onlineChorusTesting | 3 | Online chorus test. |
Field | Type | Default Value | Description |
userId | String | Required | User ID. |
quality | Required |
Field | Type | Default Value | Description |
width | int | -1 | Local video width, in pixels. |
height | int | -1 | Local video height, in pixels. |
frameRate | int | -1 | Local video frame rate, in fps, i.e., the number of video frames per second. |
videoBitrate | int | -1 | Local video bitrate, in Kbps, i.e., the amount of video data generated per second. |
audioSampleRate | int | -1 | Local audio sample rate, in Hz. |
audioBitrate | int | -1 | Local audio bitrate, in Kbps, i.e., the amount of audio data generated per second. |
streamType | TRTCVideoStreamType.big | ||
audioCaptureState | int | -1 | Capture status of the audio device. 0: Normal.1: Prolonged silence detected.2: Clipping detected.3: Abnormal audio interruption detected. |
Field | Type | Default Value | Description |
userId | String | '' | User ID. |
audioPacketLoss | int | -1 | Total packet loss rate (%) of the audio stream. This value indicates the packet loss rate finally measured on the audience side after the audio/video stream passes through the complete transmission link of "anchor > cloud > audience". The smaller the value, the better. 0 means that the audio stream data has completely reached the audience side. If downLoss is 0 but this value is not 0, there is no packet loss on the "cloud > audience" link, but unrecoverable packet loss on the "anchor > cloud" link. |
videoPacketLoss | int | -1 | Total packet loss rate (%) of the video stream. This value indicates the packet loss rate finally measured on the audience side after the audio/video stream passes through the complete transmission link of "anchor > cloud > audience". The smaller the value, the better. 0 means that the video stream data has completely reached the audience side. |
width | int | -1 | Remote video width, in pixels. |
height | int | -1 | Remote video height, in pixels. |
frameRate | int | -1 | Remote video frame rate, in fps. |
videoBitrate | int | -1 | Remote video bitrate, in Kbps. |
audioSampleRate | int | -1 | Remote audio sample rate, in Hz. |
audioBitrate | int | -1 | Remote audio bitrate, in Kbps. |
jitterBufferDelay | int | -1 | Playback delay, in milliseconds. To avoid audio and video stuttering caused by network jitter and out-of-order packets, TRTC manages a playback buffer on the playback side to organize received network packets. The size of the buffer is adaptively adjusted based on the current network quality, and this value is the size converted into a duration in milliseconds. |
point2PointDelay | int | -1 | End-to-end delay, in milliseconds. This value represents the "anchor > cloud > audience" delay. More precisely, it represents the full-link delay of "capture > encoding > network transmission > receiving > buffering > decoding > playback". This value takes effect only when both the local and remote SDKs are version 8.5 or later. If the remote SDK version is earlier than 8.5, this value is always 0 and meaningless. |
audioTotalBlockTime | int | -1 | Accumulated audio playback stutter duration, in milliseconds. |
audioBlockRate | int | -1 | Audio playback stutter rate (%). Calculation: accumulated audio playback stutter duration ( audioTotalBlockTime) / total audio playback duration. |
videoTotalBlockTime | int | -1 | Accumulated video playback stutter duration, in milliseconds. |
videoBlockRate | int | -1 | Video playback stutter rate (%). Calculation: accumulated video playback stutter duration ( videoTotalBlockTime) / total video playback duration. |
finalLoss | int | -1 | Total packet loss rate (%) of the audio/video stream. Deprecated. Use audioPacketLoss and videoPacketLoss instead. |
remoteNetworkUplinkLoss | int | -1 | Packet loss rate (%) from the remote user to the cloud. The smaller the value, the better. 0 means the upstream network quality is excellent and almost no packets uploaded to the cloud are lost; 30% means that 30% of the audio/video packets sent by the SDK to the cloud are lost on the transmission link. |
remoteNetworkRTT | int | -1 | Round-trip delay from the remote SDK to the cloud, in milliseconds. This value represents the total time taken for a network packet to travel from the remote SDK to the cloud and back to the remote SDK, i.e., the total duration of the "SDK > cloud > SDK" link. The smaller the value, the better. Below 50 ms indicates a short call delay; above 200 ms indicates a long call delay. |
streamType | TRTCVideoStreamType.big |
Field | Type | Default Value | Description |
appCpu | int | -1 | CPU usage (%) of the current application. Not supported on Android 8.0 or later. |
systemCpu | int | -1 | CPU usage (%) of the current system. Not supported on Android 8.0 or later. |
upLoss | int | -1 | Packet loss rate (%) from the SDK to the cloud (upstream). The smaller the value, the better. 0 means the upstream network quality is excellent and almost no packets uploaded to the cloud are lost; 30% means that 30% of the audio/video packets sent by the SDK to the cloud are lost on the transmission link. |
downLoss | int | -1 | Packet loss rate (%) from the cloud to the SDK (downstream). The smaller the value, the better. 0 means the downstream network quality is excellent and almost no packets received from the cloud are lost; 30% means that 30% of the audio/video packets sent by the cloud to the SDK are lost on the transmission link. |
rtt | int | -1 | Round-trip delay from the SDK to the cloud, in milliseconds. This value represents the total time taken for a network packet to travel from the SDK to the cloud and back to the SDK, i.e., the total duration of the "SDK > cloud > SDK" link. The smaller the value, the better. Below 50 ms indicates a short call delay; above 200 ms indicates a long call delay. |
gatewayRtt | int | -1 | Round-trip delay from the SDK to the gateway, in milliseconds. This value represents the total time taken for a network packet to travel from the SDK to the gateway and back to the SDK, i.e., the total duration of the "SDK > gateway > SDK" link. Note: This value is invalid on cellular networks. |
sentBytes | int | -1 | Total number of bytes sent, including signaling data and audio/video data. |
receivedBytes | int | -1 | Total number of bytes received, including signaling data and audio/video data. |
localStatisticsArray | List<TRTCLocalStatistics>? | - | Because there may be three local audio/video streams (i.e., HD big image, LD small image and substream image), the local audio/video statistics are an array. |
remoteStatisticsArray | List<TRTCRemoteStatistics>? | - | Because there may be multiple remote users at the same time, and each user may have multiple audio/video streams, the remote audio/video statistics are an array. |
Field | Type | Default Value | Description |
sdkAppId | int | 0 | |
userId | String | '' | |
userSig | String | '' | |
expectedUpBandwidth | int | 0 | Expected upstream bandwidth, in Kbps. Value range: 10 - 5000. If 0, the upstream bandwidth is not tested. Note: When scene is onlineChorusTesting, the value range is limited to 10 - 1000 to obtain more accurate RTT/jitter information. |
expectedDownBandwidth | int | 0 | Expected downstream bandwidth, in Kbps. Value range: 10 - 5000. If 0, the downstream bandwidth is not tested. Note: When scene is onlineChorusTesting, the value range is limited to 10 - 1000 to obtain more accurate RTT/jitter information. |
scene | TRTCSpeedTestScene.delayAndBandwidthTesting |
Field | Type | Default Value | Description |
success | bool | false | Whether the network speed test succeeded. |
errMsg | String | '' | Error message of the network speed test. |
ip | String | '' | Server IP address. |
quality | TRTCQuality.unknown | ||
upLostRate | double | 0.0 | Upstream packet loss rate. Value range: 0 - 1.0. For example, 0.3 means that 3 out of every 10 packets sent to the server may be lost. |
downLostRate | double | 0.0 | Downstream packet loss rate. Value range: 0 - 1.0. For example, 0.2 means that 2 out of every 10 packets received from the server may be lost. |
rtt | int | 0 | Latency in milliseconds, i.e., the round-trip time from the current device to the TRTC server. The smaller the value, the better. The normal range is 10 - 100 ms. |
availableUpBandwidth | int | 0 | Upstream bandwidth, in Kbps. -1 indicates an invalid value. |
availableDownBandwidth | int | 0 | Downstream bandwidth, in Kbps. -1 indicates an invalid value. |
upJitter | int | 0 | Upstream packet jitter, in milliseconds, reflecting the stability of data communication in the current network environment. The smaller the value, the better. The normal range is 0 - 100 ms. -1 indicates that no valid value was obtained in the speed test.Generally, the jitter of Wi-Fi networks is slightly larger than that of 4G/5G networks. |
downJitter | int | 0 | Downstream packet jitter, in milliseconds, reflecting the stability of data communication in the current network environment. The smaller the value, the better. The normal range is 0 - 100 ms. -1 indicates that no valid value was obtained in the speed test.Generally, the jitter of Wi-Fi networks is slightly larger than that of 4G/5G networks. |
Enum Value | Value | Description |
unknown | 0 | Undefined format. |
i420 | 1 | YUV420P (I420) format. |
texture2D | 2 | OpenGL 2D texture format. |
bgra32 | 3 | BGRA32 format. |
nv21 | 4 | NV21 format. |
rgba32 | 5 | RGBA format. |
Enum Value | Value | Description |
unknown | 0 | Undefined transfer method. |
buffer | 1 | Transfers video data using a memory buffer. iOS: PixelBuffer.Android: Direct Buffer at the JNI layer.Windows: Memory data block. |
texture | 3 | Transfers video data using an OpenGL texture. |
textureD3D11 | 4 | Transfers video data using a D3D11 texture. |
Field | Type | Default Value | Description |
glTextureId | int | 0 | Video texture ID. |
glContext | int | 0 | OpenGL context corresponding to the texture, applicable to Windows and Android. |
d3d11TextureId | int | 0 | D3D11 texture, i.e., a pointer to ID3D11Texture2D, applicable only to Windows. |
Field | Type | Default Value | Description |
videoFormat | TRTCVideoPixelFormat.unknown | ||
bufferType | TRTCVideoBufferType.unknown | ||
texture | TRTCTexture? | - | Video data when bufferType is texture, carrying texture data for OpenGL rendering. For details, see TRTCTexture. |
data | Uint8List | - | Video data when bufferType is buffer, carrying a memory data block at the C++ layer. |
length | int | 0 | Video data length, in bytes. It is width * height * 3 / 2 for the I420 format and width * height * 4 for the BGRA32 format. |
width | int | 640 | Video width. Fill in the width of the incoming video data. |
height | int | 360 | Video height. Fill in the height of the incoming video data. |
timestamp | int | 0 | Video frame timestamp, in milliseconds. For custom video capturing, it can be set to 0, in which case the SDK automatically fills in this field. However, set the data delivery interval "evenly". |
rotation | TRTCVideoRotation.rotation0 |
Field | Type | Default Value | Description |
audioFormat | TRTCAudioFrameFormat.none | ||
data | Uint8List | - | Audio data. |
length | int | 0 | Audio data length. |
sampleRate | int | 0 | Sample rate. |
channel | int | 0 | Number of channels. |
timestamp | int | 0 | Timestamp, in milliseconds. |
extraData | Uint8List | - | Extra data in the audio frame. Messages added to audio frames by remote users via onLocalProcessedAudioFrame are called back through this field. |
extraDataLength | int | 0 | Length of the extra data. |
Enum Value | Value | Description |
verbose | 0 | Outputs logs of all levels. |
debug | 1 | Outputs logs of DEBUG, INFO, WARNING, ERROR and FATAL levels. |
info | 2 | Outputs logs of INFO, WARNING, ERROR and FATAL levels. |
warning | 3 | Outputs logs of WARNING, ERROR and FATAL levels. |
error | 4 | Outputs logs of ERROR and FATAL levels. |
fatal | 5 | Outputs logs of FATAL level only. |
none | 6 | Does not output any SDK logs. |
Field | Type | Default Value | Description |
left | int | 0 | Coordinate of the left boundary of the rectangle. |
top | int | 0 | Coordinate of the top boundary of the rectangle. |
right | int | 0 | Coordinate of the right boundary of the rectangle. |
bottom | int | 0 | Coordinate of the bottom boundary of the rectangle. |
Field | Type | Default Value | Description |
width | int | 0 | Width. |
height | int | 0 | Height. |
피드백