tencent cloud

Feedback

Type Definition

Last updated: 2024-10-25 16:52:53
    Copyright (c) 2021 Tencent. All rights reserved.
    
    Module: V2TXLiveDef @ TXLiteAVSDK
    
    Function: Key type definitions for Tencent Cloud LVB
    
    Type Definition

    StructType

    FuncList
    DESC
    Video encoding parameters
    Video frame information
    audio callback format
    Pusher statistics
    Player statistics
    Position of each subimage in On-Cloud MixTranscoding
    Configure On-Cloud MixTranscoding
    Configure On-LocalRecording
    Protocol configured with socks5 proxy.
    Log configuration
    Stream information supporting adaptive handover.

    EnumType

    EnumType
    DESC
    Supported protocol, RTMP is not supported on Windows or macOS.
    Video resolution.
    Video aspect ratio mode
    Local camera mirror type.
    Image fill mode
    Clockwise rotation of the video image
    Pixel format of video frames
    Video data container format
    Picture-in-Picture state
    Audio quality
    Audio callback data operation mode
    Livestream connection status
    Playback mode
    Specify the type of streams to mix
    Recording audio and video mode
    Log level

    V2TXLiveMode

    V2TXLiveMode

    Supported protocol, RTMP is not supported on Windows or macOS.

    Enum
    Value
    DESC
    V2TXLiveMode_RTMP
    Not Defined
    RTMP protocol.
    V2TXLiveMode_RTC
    Not Defined
    TRTC protocol.

    V2TXLiveVideoResolution

    V2TXLiveVideoResolution

    Video resolution.

    Enum
    Value
    DESC
    V2TXLiveVideoResolution160x160
    Not Defined
    Resolution: 160×160. Bitrate range: 100 Kbps to 150 Kbps. Frame rate: 15 fps.
    V2TXLiveVideoResolution270x270
    Not Defined
    Resolution: 270×270. Bitrate range: 200 Kbps to 300 Kbps. Frame rate: 15 fps.
    V2TXLiveVideoResolution480x480
    Not Defined
    Resolution: 480×480. Bitrate range: 350 Kbps to 525 Kbps. Frame rate: 15 fps.
    V2TXLiveVideoResolution320x240
    Not Defined
    Resolution: 320×240. Bitrate range: 250 Kbps to 375 Kbps. Frame rate: 15 fps.
    V2TXLiveVideoResolution480x360
    Not Defined
    Resolution: 480×360. Bitrate range: 400 Kbps to 600 Kbps. Frame rate: 15 fps.
    V2TXLiveVideoResolution640x480
    Not Defined
    Resolution: 640×480. Bitrate range: 600 Kbps to 900 Kbps. Frame rate: 15 fps.
    V2TXLiveVideoResolution320x180
    Not Defined
    Resolution: 320×180. Bitrate range: 250 Kbps to 400 Kbps. Frame rate: 15 fps.
    V2TXLiveVideoResolution480x270
    Not Defined
    Resolution: 480×270. Bitrate range: 350 Kbps to 550 Kbps. Frame rate: 15 fps.
    V2TXLiveVideoResolution640x360
    Not Defined
    Resolution: 640×360. Bitrate range: 500 Kbps to 900 Kbps. Frame rate: 15 fps.
    V2TXLiveVideoResolution960x540
    Not Defined
    Resolution: 960×540. Bitrate range: 800 Kbps to 1500 Kbps. Frame rate: 15 fps.
    V2TXLiveVideoResolution1280x720
    Not Defined
    Resolution: 1280×720. Bitrate range: 1000 Kbps to 1800 Kbps. Frame rate: 15 fps.
    V2TXLiveVideoResolution1920x1080
    Not Defined
    Resolution: 1920×1080. Bitrate range: 2500 Kbps to 3000 Kbps. Frame rate: 15 fps.

    V2TXLiveVideoResolutionMode

    V2TXLiveVideoResolutionMode

    Video aspect ratio mode

    Note
    Landscape resolution: V2TXLiveVideoResolution640x360 + V2TXLiveVideoResolutionModeLandscape = 640 × 360.
    Portrait resolution: V2TXLiveVideoResolution640x360 + V2TXLiveVideoResolutionModePortrait = 360 × 640.
    Enum
    Value
    DESC
    V2TXLiveVideoResolutionModeLandscape
    0
    Landscape resolution.
    V2TXLiveVideoResolutionModePortrait
    1
    Portrait resolution.

    V2TXLiveMirrorType

    V2TXLiveMirrorType

    Local camera mirror type.

    Enum
    Value
    DESC
    V2TXLiveMirrorTypeAuto
    Not Defined
    Default mirror type. Images from the front camera are mirrored, and images from the rear camera are not mirrored.
    V2TXLiveMirrorTypeEnable
    Not Defined
    Both the front and rear cameras are switched to the mirror mode.
    V2TXLiveMirrorTypeDisable
    Not Defined
    Both the front and rear cameras are switched to the non-mirror mode.

    V2TXLiveFillMode

    V2TXLiveFillMode

    Image fill mode

    Enum
    Value
    DESC
    V2TXLiveFillModeFill
    Not Defined
    The entire screen is covered by the image, without black edges. If the aspect ratio of the image is different from that of the screen, part of the image will be cropped.
    V2TXLiveFillModeFit
    Not Defined
    The image adapts to the screen and is not cropped. If the aspect ratio of the image is different from that of the screen, black edges will appear.
    V2TXLiveFillModeScaleFill
    Not Defined
    The screen is entirely covered by the image. The image will be stretched if screen and image have different aspect ratios.

    V2TXLiveRotation

    V2TXLiveRotation

    Clockwise rotation of the video image

    Enum
    Value
    DESC
    V2TXLiveRotation0
    Not Defined
    No rotation.
    V2TXLiveRotation90
    Not Defined
    Rotate 90 degrees clockwise.
    V2TXLiveRotation180
    Not Defined
    Rotate 180 degrees clockwise.
    V2TXLiveRotation270
    Not Defined
    Rotate 270 degrees clockwise.

    V2TXLivePixelFormat

    V2TXLivePixelFormat

    Pixel format of video frames

    Enum
    Value
    DESC
    V2TXLivePixelFormatUnknown
    Not Defined
    Unknown.
    V2TXLivePixelFormatI420
    Not Defined
    YUV420P I420.
    V2TXLivePixelFormatNV12
    Not Defined
    YUV420SP NV12.
    V2TXLivePixelFormatBGRA32
    Not Defined
    BGRA8888.
    V2TXLivePixelFormatTexture2D
    Not Defined
    Texture2D.

    V2TXLiveBufferType

    V2TXLiveBufferType

    Video data container format

    Note
    In the custom capture and rendering features, you need to use the following enumerated values to specify the format for containing video data.
    PixelBuffer: this is most efficient when used directly. The iOS system provides various APIs to obtain or process PixelBuffer.
    NSData: when this is applied to custom rendering, PixelBuffer is copied once to NSData. When it is applied to custom capture, NSData is copied once to PixelBuffer. Therefore, the performance is affected to some extent.
    Enum
    Value
    DESC
    V2TXLiveBufferTypeUnknown
    Not Defined
    Unknown.
    V2TXLiveBufferTypePixelBuffer
    Not Defined
    This is most efficient when used directly. The iOS system provides various APIs to obtain or process PixelBuffer.
    V2TXLiveBufferTypeNSData
    Not Defined
    The performance is affected to some extent. As the SDK internally processes PixelBuffer directly, type switching between NSData and PixelBuffer results in memory copy overhead.
    V2TXLiveBufferTypeTexture
    Not Defined
    Texture.

    V2TXLivePictureInPictureState

    V2TXLivePictureInPictureState

    Picture-in-Picture state

    Enum
    Value
    DESC
    V2TXLivePictureInPictureStateUndefined
    Not Defined
    Undefined.
    V2TXLivePictureInPictureStateOccurError
    Not Defined
    An error occurred in Picture-in-Picture mode.
    V2TXLivePictureInPictureStateWillStart
    Not Defined
    Picture-in-Picture mode will start.
    V2TXLivePictureInPictureStateDidStart
    Not Defined
    Picture-in-Picture mode did start.
    V2TXLivePictureInPictureStateWillStop
    Not Defined
    Picture-in-Picture mode will stop.
    V2TXLivePictureInPictureStateDidStop
    Not Defined
    Picture-in-Picture mode did stop.
    V2TXLivePictureInPictureStateRestoreUI
    Not Defined
    Picture-in-Picture restore the user interface.

    V2TXLiveAudioQuality

    V2TXLiveAudioQuality

    Audio quality

    Enum
    Value
    DESC
    V2TXLiveAudioQualitySpeech
    Not Defined
    Audio: 16k sample rate, mono-channel, 16 Kbps audio raw bitrate. This quality is suitable for scenarios that mainly involve voice calls, such as online meetings and voice calls.
    V2TXLiveAudioQualityDefault
    Not Defined
    General: 48k sample rate, mono-channel, 50 Kbps audio raw bitrate. This quality is the default audio quality of the SDK. We recommend that you choose this option unless you have special requirements.
    V2TXLiveAudioQualityMusic
    Not Defined
    Music: 48k sample rate, dual-channel + full-band, 128 Kbps audio raw bitrate. This quality is suitable for scenarios that require Hi-Fi music transmission, such as karaoke and music livestreams.

    V2TXLiveAudioFrameOperationMode

    V2TXLiveAudioFrameOperationMode

    Audio callback data operation mode

    SDK provides two modes of operation for audio callback data.
    Read-only mode (ReadOnly): Get audio data only from the callback.
    ReadWrite mode (ReadWrite): You can get and modify the audio data of the callback.
    Enum
    Value
    DESC
    V2TXLiveAudioFrameOperationModeReadWrite
    0
    Read-write mode: You can get and modify the audio data of the callback, the default mode.
    V2TXLiveAudioFrameOperationModeReadOnly
    1
    Read-only mode: Get audio data from callback only.

    V2TXLivePushStatus

    V2TXLivePushStatus

    Livestream connection status

    Enum
    Value
    DESC
    V2TXLivePushStatusDisconnected
    Not Defined
    Disconnected from the server.
    V2TXLivePushStatusConnecting
    Not Defined
    Connecting to the server.
    V2TXLivePushStatusConnectSuccess
    Not Defined
    Connected to the server successfully.
    V2TXLivePushStatusReconnecting
    Not Defined
    Reconnecting to the server.

    V2TXAudioRoute

    V2TXAudioRoute

    Playback mode

    Enum
    Value
    DESC
    V2TXAudioModeSpeakerphone
    Not Defined
    Speaker.
    V2TXAudioModeEarpiece
    Not Defined
    Earpiece.

    V2TXLiveMixInputType

    V2TXLiveMixInputType

    Specify the type of streams to mix

    Enum
    Value
    DESC
    V2TXLiveMixInputTypeAudioVideo
    Not Defined
    Audio and video.
    V2TXLiveMixInputTypePureVideo
    Not Defined
    Video only.
    V2TXLiveMixInputTypePureAudio
    Not Defined
    Audio only.

    V2TXLiveRecordMode

    V2TXLiveRecordMode

    Recording audio and video mode

    Enum
    Value
    DESC
    V2TXLiveRecordModeBoth
    Not Defined
    Both mode: Recording audio and video

    V2TXLiveLogLevel

    V2TXLiveLogLevel

    Log level

    Enum
    Value
    DESC
    V2TXLiveLogLevelAll
    0
    Output all levels of log.
    V2TXLiveLogLevelDebug
    1
    Output DEBUG, INFO, WARNING, ERROR and FATAL level log.
    V2TXLiveLogLevelInfo
    2
    Output INFO, WARNING, ERROR and FATAL level log.
    V2TXLiveLogLevelWarning
    3
    Output WARNING, ERROR and FATAL level log.
    V2TXLiveLogLevelError
    4
    Output ERROR and FATAL level log.
    V2TXLiveLogLevelFatal
    5
    Only output FATAL level log.
    V2TXLiveLogLevelNULL
    6
    Does not output any sdk log.

    V2TXLiveVideoEncoderParam

    V2TXLiveVideoEncoderParam

    Video encoding parameters

    These settings determine the quality of image viewed by remote users.
    EnumType
    DESC
    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.
    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 set videoBitrate and minVideoBitrate to the same value, it is equivalent to disabling the adaptive adjustment capability of the SDK for the video bitrate.
    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 V2TXLiveVideoResolution . You can also slightly increase the optimal bitrate.
    For example, V2TXLiveVideoResolution1280x720 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 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).
    videoResolution
    Field description: video resolution.
    Recommended value:
    For desktop platforms (Windows and macOS), we recommend you select a resolution of 640x360 or above and select Landscape (landscape resolution) for videoResolutionMode .
    Note
    to use a portrait resolution, please specify videoResolutionMode as Portrait ; for example, when used together with Portrait , 640x360 represents 360x640.
    videoResolutionMode
    Field description: resolution mode (landscape/portrait).
    Recommended value: for desktop platforms (Windows and macOS), Landscape is recommended.
    Note
    to use a portrait resolution, please specify videoResolutionMode as Portrait ; for example, when used together with Portrait , 640x360 represents 360x640.

    V2TXLiveVideoFrame

    V2TXLiveVideoFrame

    Video frame information

    Note
    Used during custom capture and rendering. During custom capture, you need to use V2TXLiveVideoFrame to contain the video frame to be sent. During custom rendering, the video frame contained by V2TXLiveVideoFrame will be returned.
    EnumType
    DESC
    bufferType
    Field description: Video data container format.
    Recommended value: V2TXLiveBufferTypePixelBuffer.
    data
    Field description: Video data when bufferType is V2TXLiveBufferTypeNSData.
    height
    Field description: Video height.
    pixelBuffer
    Field description: Video data when bufferType is V2TXLiveBufferTypePixelBuffer.
    pixelFormat
    Field description: Video pixel format.
    Recommended value: V2TXLivePixelFormatNV12.
    rotation
    Field description: Clockwise rotation angle of video frames.
    textureId
    Field description: Texture ID.
    width
    Field description: Video width.

    V2TXLiveAudioFrameObserverFormat

    V2TXLiveAudioFrameObserverFormat

    audio callback format

    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: V2TXLiveAudioFrameOperationModeReadOnly, get audio data from callback only. The modes that can be set are V2TXLiveAudioFrameOperationModeReadOnly, V2TXLiveAudioFrameOperationModeReadWrite.
    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.

    V2TXLivePusherStatistics

    V2TXLivePusherStatistics

    Pusher statistics

    EnumType
    DESC
    appCpu
    Field description: CPU utilization of the current app (%).
    audioBitrate
    Field description: Audio bitrate (Kbps).
    fps
    Field description: Frame rate (fps).
    height
    Field description: Video height.
    netSpeed
    Field description: upload speed (Kbps).
    rtt
    Field description: Round-trip delay (ms) from the SDK to cloud.
    systemCpu
    Field description: CPU utilization of the current system (%).
    videoBitrate
    Field description: Video bitrate (Kbps).
    width
    Field description: Video width.

    V2TXLivePlayerStatistics

    V2TXLivePlayerStatistics

    Player statistics

    EnumType
    DESC
    appCpu
    Field description: CPU utilization of the current app (%).
    audioBitrate
    Field description: Audio bitrate (Kbps).
    audioBlockRate
    Field description : Audio playback lag rate (%).
    Audio playback lag rate (audioBlockRate) = cumulative audio playback lag duration (audioTotalBlockTime)/audio playback interval duration (2000ms).
    audioPacketLoss
    Field description : Total packet loss rate (%) of the audio/video stream. Note: Only playback address prefixed with [trtc://] or [webrtc://] are supported.
    audioTotalBlockTime
    Field description : Cumulative audio playback lag duration (ms).
    The duration is the block duration within 2s.
    fps
    Field description: Frame rate (fps).
    height
    Field description: Video height.
    jitterBufferDelay
    Field description : Playback delay (ms).
    netSpeed
    Field description: donwload speed (Kbps).
    rtt
    Field description: Round-trip delay (ms) from the SDK to cloud. Note: Only playback address prefixed with [trtc://] or [webrtc://] are supported.
    systemCpu
    Field description: CPU utilization of the current system (%).
    videoBitrate
    Field description: Video bitrate (Kbps).
    videoBlockRate
    Field description : Video playback lag rate (%).
    Video playback lag rate (videoBlockRate) = cumulative video playback lag duration (videoTotalBlockTime)/video playback interval duration (2000ms).
    videoPacketLoss
    Field description : Total packet loss rate (%) of the audio/video stream. Note: Only playback address prefixed with [trtc://] or [webrtc://] are supported.
    videoTotalBlockTime
    Field description : Cumulative video playback lag duration (ms).
    The duration is the block duration within 2s.
    width
    Field description: Video width.

    V2TXLiveMixStream

    V2TXLiveMixStream

    Position of each subimage in On-Cloud MixTranscoding

    EnumType
    DESC
    height
    Field description: height (absolute pixels) of the image layer.
    inputType
    Field description: input type of the live stream.
    streamId
    Field description: push streamId of users whose streams are mixed. nil indicates the current push streamId .
    userId
    Field description: userId of users whose streams are mixed.
    width
    Field description: width (absolute pixels) of the image layer.
    x
    Field description: x-axis (absolute pixels) of the image layer.
    y
    Field description: y-axis (absolute pixels) of the image layer.
    zOrder
    Field description: layer number (1-15), which must be unique.

    V2TXLiveTranscodingConfig

    V2TXLiveTranscodingConfig

    Configure On-Cloud MixTranscoding

    EnumType
    DESC
    audioBitrate
    Field description: audio bitrate of the transcoded stream.
    Value range: [32,192]; default value: 64 (Kbps).
    audioChannels
    Field description: number of sound channels of the transcoded stream.
    Valid values: 1 (default), 2.
    audioSampleRate
    Field description: audio sample rate of the transcoded stream.
    Valid values: 12000 Hz, 16000 Hz, 22050 Hz, 24000 Hz, 32000 Hz, 44100 Hz, 48000 Hz (default).
    backgroundColor
    Field description: background color of the mixed video image. The default color is black, and the value is a hex number. For example: "0x61B9F1" represents the RGB color (97,158,241).
    Default value: 0x000000 (black)
    backgroundImage
    Field description: background image of the mixed video.
    Default value: nil , which means that no background image is set.
    Note
    you need to first upload the image in Application Management > Function Configuration > Material Management in the console.
    You will get an image ID for the image uploaded, which you need to convert to a string and use it as the value of backgroundImage .
    For example, if the image ID is 63, you should set backgroundImage to 63 .
    mixStreams
    Field description: position of each channel of subimage.
    outputStreamId
    Field description: ID of the live stream pushed to CDN.
    If you do not set this parameter, the SDK will execute the default logic, that is, it will mix multiple streams in the room into the video stream of the API caller, i.e., A + B => A.
    If you set this parameter, the SDK will mix multiple streams in the room into the live stream whose ID you have specified, i.e., A + B => C.
    Default value : nil , which indicates that multiple streams in the room are mixed into the video stream of the API caller.
    videoBitrate
    Field description: bitrate (Kbps) for the resolution of the transcoded video.
    Recommended value: if you set it to 0, the backend will calculate a bitrate based on videoWidth and videoHeight . You can also refer to the remarks for the enumerated value V2TXLiveVideoResolution .
    videoFramerate
    Field description: frame rate (fps) for the resolution of the transcoded video.
    Value range: (0,30]; default: 15.
    videoGOP
    Field description: keyframe interval (GOP) for the resolution of the transcoded video.
    Value range: [1,8]; default value: 2 (sec).
    videoHeight
    Field description: height of transcoded video.
    Recommended value: 640 px. If audio-only streams are mixed, the mixing result will carry a video stream that shows a canvas background. To avoid this, set both the width and height to 0 px.
    videoWidth
    Field description: width of transcoded video.
    Recommended value: 360 px. If audio-only streams are mixed, the mixing result will carry a video stream that shows a canvas background. To avoid this, set both the width and height to 0 px.

    V2TXLiveLocalRecordingParams

    V2TXLiveLocalRecordingParams

    Configure On-LocalRecording

    EnumType
    DESC
    filePath
    Field description: The path of the recorded file (required), please ensure that the path has read and write permissions and is legal, otherwise the recorded file cannot be generated.
    Recommended value: "yourpath/record/test.mp4". The path needs to be accurate to the file name and format suffix. The format suffix is used to determine the recorded file format. The currently supported format is only MP4.
    interval
    Field description: interval Recording information update frequency (optional), in milliseconds, valid range: 1000-10000.
    Default value : -1 , which means no callback.
    recordMode
    Field description: Media recording mode.
    Default value : V2TXLiveRecordModeBoth , which means recording audio and video at the same time.

    V2TXLiveSocks5ProxyConfig

    V2TXLiveSocks5ProxyConfig

    Protocol configured with socks5 proxy.

    EnumType
    DESC
    supportHttps
    Field description: Indicates whether HTTPS is supported.
    Recommended value: Default value: true.
    supportTcp
    Field description: Indicates whether TCP is supported.
    Recommended value: Default value: true.
    supportUdp
    Field description: Indicates whether UDP is supported.
    Recommended value: Default value: true.

    V2TXLiveLogConfig

    V2TXLiveLogConfig

    Log configuration

    EnumType
    DESC
    enableConsole
    Field description: Whether to allow the SDK to print Log on the console of the editor (XCoder, Android Studio, Visual Studio, etc.).
    Recommended value: Default value: NO.
    enableLogFile
    Field description: Whether to enable local log file.
    Special Instructions: If not for special needs, please do not close the local log file, otherwise the Tencent Cloud technical team will not be able to track and locate problems when they occur.
    Recommended value: Default value: YES.
    enableObserver
    Field description: Whether to receive the log information to be printed through V2TXLivePremierObserver.
    Special Instructions: If you want to implement Log writing by yourself, you can turn on this switch, Log information will be called back to you V2TXLivePremierObserver#onLog.
    Recommended value: Default value: NO.
    logLevel
    Field description: Set Log level.
    Recommended value: Default value: V2TXLiveLogLevelAll.
    logPath
    Field description: Set the storage directory of the local log, default Log storage location:
    iOS & Mac: sandbox Documents/log.

    V2TXLiveStreamInfo

    V2TXLiveStreamInfo

    Stream information supporting adaptive handover.

    EnumType
    DESC
    bitrate
    Field description: Bitrate in bps, default value: 0, means unknown.
    framerate
    Field description: Framerate, default value: 0, means unknown.
    height
    Field description: Video height, default value: 0, means unknown.
    url
    Field description: Stream url.
    width
    Field description: Video width, default value: 0, means unknown.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support