CloudHub Docs
Download Documents

RTC


CloudHubSDK iOS

Data type

CloudHubRtcLocalVideoStats

Statistics of the local video stream

Property

sourceID

@property (copy, nonatomic) NSString*  _Nullable sourceID;

Device ID of the video stream

sentBitrate

@property (assign, nonatomic) NSUInteger sentBitrate;

Bitrate (Kbps) sent in the reported interval, which does not include the bitrate of the retransmission video after packet loss

sentFrameRate

@property (assign, nonatomic) NSUInteger sentFrameRate;

Frame rate (fps) sent in the reported interval, which does not include the frame rate of the retransmission video after packet loss

encoderOutputFrameRate

@property (assign, nonatomic) NSUInteger encoderOutputFrameRate;

The encoder output frame rate (fps) of the local video

rendererOutputFrameRate

@property (assign, nonatomic) NSUInteger rendererOutputFrameRate;

The renderer output frame rate (fps) of the local video

targetBitrate

@property (assign, nonatomic) NSUInteger targetBitrate;

The target bitrate (bps) of the current encoder. This value is estimated by the SDK based on the current network conditions

targetFrameRate

@property (assign, nonatomic) NSUInteger targetFrameRate;

The target frame rate (fps) of the current encoder

encodedBitrate

@property (assign, nonatomic) NSUInteger encodedBitrate;

The encoding bitrate (bps), which does not include the bitrate of the re-transmission video after packet loss

encodedFrameWidth

@property (assign, nonatomic) NSUInteger encodedFrameWidth;

The width of the encoding frame (px)

encodedFrameHeight

@property (assign, nonatomic) NSUInteger encodedFrameHeight;

The height of the encoding frame (px)

encodedFrameCount

@property (assign, nonatomic) NSUInteger encodedFrameCount;

The value of the sent frames, represented by an aggregate value

codecType

@property (assign, nonatomic) CloudHubVideoCodecType codecType;

The codec type of the local video:CloudHubVideoCodecType

CloudHubRtcRemoteVideoStats

Statistics of the remote video stream.

Property

uid

@property (copy, nonatomic) NSString* _Nullable uid;

User ID of the user sending the video streams

sourceID

@property (copy, nonatomic) NSString* _Nullable sourceID;

ID of the video stream

type

@property (assign, nonatomic) CloudHubMediaType type;

See CloudHubMediaType

width

@property (assign, nonatomic) NSUInteger width;

Width (pixels) of the video stream

height

@property (assign, nonatomic) NSUInteger height;

Height (pixels) of the video stream

receivedBitrate

@property (assign, nonatomic) NSUInteger receivedBitrate;

The average bitrate (bps) of the received video stream

decoderOutputFrameRate

@property (assign, nonatomic) NSUInteger decoderOutputFrameRate;

The decoder output frame rate (fps) of the remote video

rendererOutputFrameRate

@property (assign, nonatomic) NSUInteger rendererOutputFrameRate;

The renderer output frame rate (fps) of the remote video

packetLossRate

@property (assign, nonatomic) NSUInteger packetLossRate;

Packet loss rate (%) of the remote video stream after using the anti-packet-loss method.

totalFrozenTime

@property (assign, nonatomic) NSUInteger totalFrozenTime;

The total freeze time (ms) of the remote video stream after the remote user joins the channel. In a video session where the frame rate is set to no less than 5 fps, video freeze occurs when the time interval between two adjacent renderable video frames is more than 500 ms.

frozenRate

@property (assign, nonatomic) NSUInteger frozenRate;

The total video freeze time as a percentage (%) of the total time when the video is available.

CloudHubRtcLocalAudioStats

The statistics of the local audio stream

Property

numChannels

@property (assign, nonatomic) NSUInteger numChannels;

The number of channels

sentSampleRate

@property (assign, nonatomic) NSUInteger sentSampleRate;

The sample rate (Hz)

sentBitrate

@property (assign, nonatomic) NSUInteger sentBitrate;

The average sending bitrate (Kbps).

CloudHubRtcRemoteAudioStats

The statistics of the remote audio stream

Property

uid

@property (copy, nonatomic) NSString* _Nullable uid;

User ID of the user sending the audio stream

quality

@property (assign, nonatomic) NSUInteger quality;

Audio quality received by the user

networkTransportDelay

@property (assign, nonatomic) NSUInteger networkTransportDelay;

Network delay (ms) from the sender to the receiver

jitterBufferDelay

@property (assign, nonatomic) NSUInteger jitterBufferDelay;

Network delay (ms) from the receiver to the jitter buffer

audioLossRate

@property (assign, nonatomic) NSUInteger audioLossRate;

The audio frame loss rate in the reported interval

numChannels

@property (assign, nonatomic) NSUInteger numChannels;

The number of channels.

receivedSampleRate

@property (assign, nonatomic) NSUInteger receivedSampleRate;

The sample rate (Hz) of the received audio stream in the reported interval

receivedBitrate

@property (assign, nonatomic) NSUInteger receivedBitrate;

The average bitrate (bps) of the received audio stream in the reported interval

totalFrozenTime

@property (assign, nonatomic) NSUInteger totalFrozenTime;

The total freeze time (ms) of the remote audio stream after the remote user joins the channel

In every two seconds, the audio frame loss rate reaching 4% is counted as one audio freeze. The total audio freeze time = The audio freeze number × 2000 ms

frozenRate

@property (assign, nonatomic) NSUInteger frozenRate;

The total audio freeze time as a percentage (%) of the total time when the audio is available

CloudHubChannelStats

Property

duration

@property (assign, nonatomic) NSInteger duration;

Call duration (s), represented by an aggregate value

txBytes

@property (assign, nonatomic) NSInteger txBytes;

Total number of bytes transmitted, represented by an aggregate value

rxBytes

@property (assign, nonatomic) NSInteger rxBytes;

Total number of bytes received, represented by an aggregate value

txAudioBytes

@property (assign, nonatomic) NSInteger txAudioBytes;

Total number of audio bytes sent (bytes), represented by an aggregate value

txVideoBytes

@property (assign, nonatomic) NSInteger txVideoBytes;

Total number of video bytes sent (bytes), represented by an aggregate value

rxAudioBytes

@property (assign, nonatomic) NSInteger rxAudioBytes;

Total number of audio bytes received (bytes), represented by an aggregate value

rxVideoBytes

@property (assign, nonatomic) NSInteger rxVideoBytes;

Total number of video bytes received (bytes), represented by an aggregate value

txKBitrate

@property (assign, nonatomic) NSInteger txKBitrate;

Total packet transmission bitrate (Kbps), represented by an instantaneous value

rxKBitrate

@property (assign, nonatomic) NSInteger rxKBitrate;

Total receive bitrate (Kbps), represented by an instantaneous value

txAudioKBitrate

@property (assign, nonatomic) NSInteger txAudioKBitrate;

Audio packet transmission bitrate (Kbps), represented by an instantaneous value

rxAudioKBitrate

@property (assign, nonatomic) NSInteger rxAudioKBitrate;

Audio receive bitrate (Kbps), represented by an instantaneous value

txVideoKBitrate

@property (assign, nonatomic) NSInteger txVideoKBitrate;

Video transmission bitrate (Kbps), represented by an instantaneous value

rxVideoKBitrate

@property (assign, nonatomic) NSInteger rxVideoKBitrate;

Video receive bitrate (Kbps), represented by an instantaneous value

lastmileDelay

@property (assign, nonatomic) NSInteger lastmileDelay;

Client-server latency (ms)

txPacketLossRate

@property (assign, nonatomic) NSInteger txPacketLossRate;

The packet loss rate (%) from the local client to Cloudhub’s edge server, before using the anti-packet-loss method

rxPacketLossRate

@property (assign, nonatomic) NSInteger rxPacketLossRate;

The packet loss rate (%) from Cloudhub’s edge server to the local client, before using the anti-packet-loss method.

cpuTotalUsage

@property (assign, nonatomic) double cpuTotalUsage;

System CPU usage (%)

CloudHubVideoEncoderConfiguration

Properties of the video encoder configuration

Property

dimensions

@property (assign, nonatomic) CGSize dimensions;

The video frame dimension (px) used to specify the video quality in the total number of pixels along a frame’s width and height. The default value is 320 x 240. You can customize the dimension, or select from the following list:

frameRate

@property (assign, nonatomic) CloudHubVideoFrameRate frameRate;

The frame rate of the video (fps)

方法

initWithSize:frameRate

init CloudHubVideoEncoderConfiguration

- (instancetype _Nonnull)initWithSize:(CGSize)size
                            frameRate:(CloudHubVideoFrameRate)frameRate;

Parameter

ParameterDescription
sizeresolution ratio
frameRateframeRate,See CloudHubVideoFrameRate

Returns

initWithWidth:height:frameRate

init CloudHubVideoEncoderConfiguration 对象

- (instancetype _Nonnull)initWithWidth:(NSInteger)width
                                height:(NSInteger)height
                             frameRate:(CloudHubVideoFrameRate)frameRate;

Parameter

ParameterDescription
widthWidth (px) of the video
heightHeight (px) of the video
frameRateframeRate,See CloudHubVideoFrameRate

Returns

CloudHubLocalMovieInfo

Property

hasAudio

@property (nonatomic, assign) BOOL hasAudio;

hasVideo

@property (nonatomic, assign) BOOL hasVideo;

duration

@property (nonatomic, assign) NSUInteger duration;

CloudHubAudioVolumeInfo

Properties of the audio volume information.

An array containing the user ID and volume information for each speaker.

Property

uid

@property (copy, nonatomic) NSString* _Nonnull uid;

User ID of the speaker

volume

@property (assign, nonatomic) NSUInteger volume;

The volume of the speaker. The volume ranges between 0 (lowest volume) and 255 (highest volume).

vad

@property (nonatomic, assign) NSUInteger vad;

Voice activity status of the local user

note

CloudHubTranscodingStream

The video properties of the stream displaying the video in the CDN live. CloudHub supports a maximum of 24 transcoding streams in a CDN streaming channel.

Property

uid

@property (nonatomic, copy) NSString * _Nonnull uid;

User ID

type

@property (nonatomic, assign) CloudHubMediaType type;

See CloudHubMediaType

sourceID

@property (nonatomic, copy) NSString * _Nonnull sourceID;

source ID

x

@property (nonatomic, assign) int x;

Horizontal position (pixel) of the video frame relative to the top left corner.

y

@property (nonatomic, assign) int y;

Vertical position (pixel) of the video frame relative to the top left corner.

width

@property (nonatomic, assign) int width;

Width (pixel) of the video frame. The default value is 360.

height

@property (nonatomic, assign) int height;

Height (pixel) of the video frame. The default value is 640.

zOrder

@property (nonatomic, assign)int zOrder;

Layer position of the video frame. The value ranges between 0 and 100.

CloudHubLiveTranscoding

A struct for managing CDN live audio/video transcoding settings

Property

width

@property (nonatomic, assign) int      width;

The width of the output media stream in pixels.

height

@property (nonatomic, assign) int      height;

The height of the output media stream in pixels.

videoBitrate

@property (nonatomic, assign) int      videoBitrate;

The video bitrate (Kbps) of the output media stream

videoFramerate

@property (nonatomic, assign) int      videoFramerate;

The video frame rate (fps) of the output media stream

videoGop

@property (nonatomic, assign) int      videoGop;

The video GOP (Group of Pictures) of the output media stream

videoCodecProfile

@property (nonatomic, assign) CloudHubVideoCodecProfile      videoCodecProfile;

See CloudHubVideoCodecProfile

backgroundColor

@property (nonatomic, assign) unsigned int  backgroundColor;

The video background color of the output media stream

transcodingStreams

@property (nonatomic, copy) NSArray * _Nonnull transcodingStreams;

CloudHubTranscodingStream 数组

transcodingExtraInfo

@property (nonatomic, copy) NSString * _Nullable transcodingExtraInfo;

This parameter is used to send SEI information to the CDN

audioSampleRate

@property (nonatomic, assign) CloudHubAudioSampleRate audioSampleRate;

The audio sampling rate (Hz) of the output media stream, See CloudHubAudioSampleRate

audioBitrate

@property (nonatomic, assign) int           audioBitrate;

The audio bitrate (Kbps) of the output media stream

audioChannels

@property (nonatomic, assign) int           audioChannels;

The number of audio channels of the output media stream

CloudHubLastmileProbeConfig

Configurations of the last-mile network probe test

Property

@property (nonatomic, assign) BOOL probeUplink;

Sets whether or not to test the uplink network. Some users, for example, the audience in a Live-broadcast channel, do not need such a test

@property (nonatomic, assign) BOOL probeDownlink;

Sets whether or not to test the downlink network

expectedUplinkBitrate

@property (nonatomic, assign) unsigned int expectedUplinkBitrate;

The expected maximum sending bitrate (bps) of the local user The value ranges between 100000 and 2000000,We recommend setting this parameter according to the bitrate value set by setVideoEncoderConfiguration:

expectedDownlinkBitrate

@property (nonatomic, assign) unsigned int expectedDownlinkBitrate;

he expected maximum receiving bitrate (bps) of the local user. The value

CloudHubLastmileProbeResult

The uplink and downlink last-mile network probe test result

Property

state

@property (nonatomic, assign) CloudHubLastmileProbeResultState state;

The state of the probe test

uplinkPacketLossRate

@property (nonatomic, assign) unsigned int uplinkPacketLossRate;

The uplink last-mile packet loss rate (%)

uplinkAvailableBandwidth

@property (nonatomic, assign) unsigned int uplinkAvailableBandwidth;

The uplink last-mile estimated available bandwidth (bps)

downlinkPacketLossRate

@property (nonatomic, assign) unsigned int downlinkPacketLossRate;

The downlink last-mile packet loss rate (%)

downlinkAvailableBandwidth

@property (nonatomic, assign) unsigned int downlinkAvailableBandwidth;

The downlink last-mile estimated available bandwidth (bps)

rtt

@property (nonatomic, assign) unsigned int rtt;

The round-trip delay time (ms)

CloudHubChannelMediaRelayInfo

Property

uid

@property (nonatomic, strong) NSString * _Nullable uid;

For sourceInfo: The user ID to be relayed. For destinationInfos: the user ID in the destination channel

channelID

@property (nonatomic, strong) NSString * _Nullable channelID;

The source/destination channel id

token

@property (nonatomic, strong) NSString * _Nullable token;

The token to join destination channel

CloudHubChannelMediaRelayConfig

Property

destinationInfos

@property (nonatomic, strong) NSDictionary<NSString*, CloudHubChannelMediaRelayInfo*>* _Nonnull destinationInfos;

Pointer to the information of the destination channel: ChannelMediaInfo:CloudHubChannelMediaRelayInfo ,It contains the following members:

CloudHubBeautyOptions

The image enhancement options in setBeautyEffectOptions function

lighteningContrastLevel

@property (nonatomic, assign) CloudHubLighteningContrastLevel lighteningContrastLevel;

The lightening contrast level used with the lighteningLevel property:

lighteningLevel

@property (nonatomic, assign) float lighteningLevel;

The brightness level.

The default value is 0.7. The value ranges from 0.0 (original) to 1.0.

smoothnessLevel

@property (nonatomic, assign) float smoothnessLevel;

The sharpness level.

The default value is 0.5. The value ranges from 0.0 (original) to 1.0. This parameter is usually used to remove blemishes.

rednessLevel

@property (nonatomic, assign) float rednessLevel;

The redness level.

The default value is 0.1. The value ranges from 0.0 (original) to 1.0. This parameter adjusts the red saturation level.

CloudHubVideoEffectOptions

The image enhancement options in setBeautyEffectOptions function

sharpLevel

@property (nonatomic, assign) float sharpLevel;

sharpening,The value range is [0.0, 1.0], where 0.0 represents the original effect, and the default value is 0.5. Can be used to achieve sharpening and other visual effects

thinFaceLevel

@property (nonatomic, assign) float thinFaceLevel;

Thin face, the value range is [0.0, 1.0], where 0.0 represents the original effect, and the default value is 0.5. Can be used to achieve thin face and other visual effects

bigEyesLevel

@property (nonatomic, assign) float bigEyesLevel;

Big eye, the value range is [0.0, 1.0], where 0.0 represents the original effect, and the default value is 0.5. It can be used to achieve visual effects such as big eyes

sticker

@property (nonatomic, assign) CloudHubVideoEffectSticker sticker;