LiteAVSDK
Tencent Cloud TRTC SDK, is a high availability components serving tens of thousands of enterprise customers, which is committed to helping you to minimize your research and development costs.
V2TXLiveDef

Packages

package  com.tencent.live2
 

Data Structures

interface  V2TXLiveDef.V2TXLiveMode
 
interface  V2TXLiveDef.V2TXLiveVideoResolution
 
interface  V2TXLiveDef.V2TXLiveVideoResolutionMode
 
class  V2TXLiveDef.V2TXLiveVideoEncoderParam
 
interface  V2TXLiveDef.V2TXLiveMirrorType
 
interface  V2TXLiveDef.V2TXLiveFillMode
 
interface  V2TXLiveDef.V2TXLiveRotation
 
interface  V2TXLiveDef.V2TXLivePixelFormat
 
interface  V2TXLiveDef.V2TXLiveBufferType
 
class  V2TXLiveDef.V2TXLiveTexture
 
class  V2TXLiveDef.V2TXLiveVideoFrame
 
interface  V2TXLiveDef.V2TXLiveAudioQuality
 
class  V2TXLiveDef.V2TXLiveAudioFrame
 
class  V2TXLiveDef.V2TXLivePusherStatistics
 
class  V2TXLiveDef.V2TXLivePlayerStatistics
 
interface  V2TXLiveDef.V2TXLivePushStatus
 
interface  V2TXLiveDef.V2TXLiveMixInputType
 
class  V2TXLiveDef.V2TXLiveMixStream
 
class  V2TXLiveDef.V2TXLiveTranscodingConfig
 
class  V2TXLiveDef.V2TXLiveLogLevel
 
class  V2TXLiveDef.V2TXLiveLogConfig
 
class  V2TXLiveDef
 

Detailed Description

Key type definitions for Tencent Cloud LVB.


Data Structure Documentation

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveMode

interface com::tencent::live2::V2TXLiveDef::V2TXLiveMode

Supported protocol.

Data Fields
TXLiveMode_RTC TRTC protocol.
TXLiveMode_RTMP RTMP protocol.

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveVideoResolution

interface com::tencent::live2::V2TXLiveDef::V2TXLiveVideoResolution

Video resolution.

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

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveVideoResolutionMode

interface com::tencent::live2::V2TXLiveDef::V2TXLiveVideoResolutionMode

Video aspect ratio mode.

Attention
  • Landscape resolution: V2TXLiveVideoResolution640x360 + V2TXLiveVideoResolutionModeLandscape = 640 × 360
  • Portrait resolution: V2TXLiveVideoResolution640x360 + V2TXLiveVideoResolutionModePortrait = 360 × 640
Data Fields
V2TXLiveVideoResolutionModeLandscape Landscape resolution.
V2TXLiveVideoResolutionModePortrait Portrait resolution.

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveVideoEncoderParam

class com::tencent::live2::V2TXLiveDef::V2TXLiveVideoEncoderParam

Video encoding parameters

These settings determine the quality of image viewed by remote users

Public Member Functions

 V2TXLiveVideoEncoderParam (V2TXLiveVideoResolution videoResolution)
 
String toString ()
 

Data Fields

V2TXLiveVideoResolution videoResolution
 
V2TXLiveVideoResolutionMode videoResolutionMode
 
int videoFps
 
int videoBitrate
 
int minVideoBitrate
 

Constructor & Destructor Documentation

◆ V2TXLiveVideoEncoderParam()

Member Function Documentation

◆ toString()

String toString ( )
inline

Field Documentation

◆ minVideoBitrate

int minVideoBitrate

◆ videoBitrate

int videoBitrate

◆ videoFps

int videoFps

◆ videoResolution

V2TXLiveVideoResolution videoResolution

◆ videoResolutionMode

V2TXLiveVideoResolutionMode videoResolutionMode

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveMirrorType

interface com::tencent::live2::V2TXLiveDef::V2TXLiveMirrorType

Local camera mirror type.

Data Fields
V2TXLiveMirrorTypeAuto Default mirror type. Images from the front camera are mirrored, and images from the rear camera are not mirrored.
V2TXLiveMirrorTypeDisable Both the front and rear cameras are switched to the non-mirror mode.
V2TXLiveMirrorTypeEnable Both the front and rear cameras are switched to the mirror mode.

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveFillMode

interface com::tencent::live2::V2TXLiveDef::V2TXLiveFillMode

Image fill mode.

Data Fields
V2TXLiveFillModeFill 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 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.

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveRotation

interface com::tencent::live2::V2TXLiveDef::V2TXLiveRotation

Clockwise rotation of the video image.

Data Fields
V2TXLiveRotation0 No rotation.
V2TXLiveRotation180 Rotate 180 degrees clockwise.
V2TXLiveRotation270 Rotate 270 degrees clockwise.
V2TXLiveRotation90 Rotate 90 degrees clockwise.

◆ com::tencent::live2::V2TXLiveDef::V2TXLivePixelFormat

interface com::tencent::live2::V2TXLiveDef::V2TXLivePixelFormat

Pixel format of video frames.

Data Fields
V2TXLivePixelFormatI420 YUV420P I420.
V2TXLivePixelFormatTexture2D Texture2D.
V2TXLivePixelFormatUnknown Unknown.

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveBufferType

interface com::tencent::live2::V2TXLiveDef::V2TXLiveBufferType

Video data container format.

Attention
In the custom capture and rendering features, you need to use the following interfaceerated values to specify the format for containing video data.
  • Texture: this is most efficient when used directly.
Data Fields
V2TXLiveBufferTypeByteArray ByteArray.
V2TXLiveBufferTypeByteBuffer ByteBuffer.
V2TXLiveBufferTypeTexture Texture.
V2TXLiveBufferTypeUnknown Unknown.

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveTexture

class com::tencent::live2::V2TXLiveDef::V2TXLiveTexture

Video texture container.

Data Fields
egl eglContext10 EGL Context.
opengl eglContext14 EGL Context.
int textureId the ID of Texture2D

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveVideoFrame

class com::tencent::live2::V2TXLiveDef::V2TXLiveVideoFrame

Video frame information V2TXLiveVideoFrame describes the raw data of a video image frame, which can be the image before frame encoding or the image after frame decoding.

Attention
Used during custom capture and rendering. During custom capture, you need to use TXLiveVideoFrame to contain the video frame to be sent. During custom rendering, the video frame contained by TXLiveVideoFrame will be returned.
Data Fields
ByteBuffer buffer Field description: Video data
V2TXLiveBufferType bufferType Field description: Video data container format.
byte[] data Field description: Video data
int height Field description: Video height.
V2TXLivePixelFormat pixelFormat Field description: Video pixel format.
int rotation Field description: Clockwise rotation angle of video frames.
V2TXLiveTexture texture Field description: Video texture container
int width Field description: Video width

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveAudioQuality

interface com::tencent::live2::V2TXLiveDef::V2TXLiveAudioQuality

Audio quality.

Data Fields
V2TXLiveAudioQualityDefault 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 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.
V2TXLiveAudioQualitySpeech 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.

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveAudioFrame

class com::tencent::live2::V2TXLiveDef::V2TXLiveAudioFrame
Data Fields
int channel Field description: number of sound channels
byte[] data Field description: audio data
int sampleRate Field description: audio sample rate

◆ com::tencent::live2::V2TXLiveDef::V2TXLivePusherStatistics

class com::tencent::live2::V2TXLiveDef::V2TXLivePusherStatistics

Pusher statistics.

Data Fields
int appCpu Field description: CPU utilization of the current app (%)
int audioBitrate Field description: Audio bitrate (Kbps)
int fps Field description: Frame rate (fps)
int height Field description: Video height
int systemCpu Field description: CPU utilization of the current system (%)
int videoBitrate Field description: Video bitrate (Kbps)
int width Field description: Video width

◆ com::tencent::live2::V2TXLiveDef::V2TXLivePlayerStatistics

class com::tencent::live2::V2TXLiveDef::V2TXLivePlayerStatistics

Player statistics.

Data Fields
int appCpu Field description: CPU utilization of the current app (%)
int audioBitrate Field description: Audio bitrate (Kbps)
int fps Field description: Frame rate (fps)
int height Field description: Video height
int systemCpu Field description: CPU utilization of the current system (%)
int videoBitrate Field description: Video bitrate (Kbps)
int width Field description: Video width

◆ com::tencent::live2::V2TXLiveDef::V2TXLivePushStatus

interface com::tencent::live2::V2TXLiveDef::V2TXLivePushStatus

Livestream connection status.

Data Fields
V2TXLivePushStatusConnecting Connecting to the server.
V2TXLivePushStatusConnectSuccess Connected to the server successfully.
V2TXLivePushStatusDisconnected Disconnected from the server.
V2TXLivePushStatusReconnecting Reconnecting to the server.

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveMixInputType

interface com::tencent::live2::V2TXLiveDef::V2TXLiveMixInputType

Specify the type of streams to mix.

Data Fields
V2TXLiveMixInputTypeAudioVideo Audio and video.
V2TXLiveMixInputTypePureAudio Audio only.
V2TXLiveMixInputTypePureVideo Video only.

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveMixStream

class com::tencent::live2::V2TXLiveDef::V2TXLiveMixStream

Position of each subimage in On-Cloud MixTranscoding.

Public Member Functions

 V2TXLiveMixStream ()
 
 V2TXLiveMixStream (String userId, int x, int y, int width, int height, int zOrder)
 
 V2TXLiveMixStream (V2TXLiveMixStream original)
 
String toString ()
 

Data Fields

String userId
 
String streamId
 
int x
 
int y
 
int width
 
int height
 
int zOrder
 
V2TXLiveMixInputType inputType
 

Constructor & Destructor Documentation

◆ V2TXLiveMixStream() [1/3]

V2TXLiveMixStream ( )
inline

◆ V2TXLiveMixStream() [2/3]

V2TXLiveMixStream ( String  userId,
int  x,
int  y,
int  width,
int  height,
int  zOrder 
)
inline

◆ V2TXLiveMixStream() [3/3]

V2TXLiveMixStream ( V2TXLiveMixStream  original)
inline

Member Function Documentation

◆ toString()

String toString ( )
inline

Field Documentation

◆ height

int height

Field description: height (absolute pixels) of the image layer

◆ inputType

Field description: input type of the live stream

◆ streamId

String streamId

Field description: push streamId of users whose streams are mixed. nil indicates the current push streamId.

◆ userId

String userId

Field description: userId of users whose streams are mixed

◆ width

int width

Field description: width (absolute pixels) of the image layer

◆ x

int x

Field description: x-axis (absolute pixels) of the image layer

◆ y

int y

Field description: y-axis (absolute pixels) of the image layer

◆ zOrder

int zOrder

Field description: layer number (1-15), which must be unique

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveTranscodingConfig

class com::tencent::live2::V2TXLiveDef::V2TXLiveTranscodingConfig

Configure On-Cloud MixTranscoding.

Public Member Functions

 V2TXLiveTranscodingConfig ()
 
 V2TXLiveTranscodingConfig (V2TXLiveTranscodingConfig original)
 
String toString ()
 

Data Fields

int videoWidth
 
int videoHeight
 
int videoBitrate
 
int videoFramerate
 
int videoGOP
 
int backgroundColor
 
String backgroundImage
 
int audioSampleRate
 
int audioBitrate
 
int audioChannels
 
ArrayList< V2TXLiveMixStreammixStreams
 
String outputStreamId
 

Constructor & Destructor Documentation

◆ V2TXLiveTranscodingConfig() [1/2]

◆ V2TXLiveTranscodingConfig() [2/2]

Member Function Documentation

◆ toString()

String toString ( )
inline

Field Documentation

◆ audioBitrate

int audioBitrate

Field description: audio bitrate of the transcoded stream Value range: [32,192]; default value: 64 (Kbps)

◆ audioChannels

int audioChannels

Field description: number of sound channels of the transcoded stream Valid values: 1 (default), 2

◆ audioSampleRate

int 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

int 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

String 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

ArrayList<V2TXLiveMixStream> mixStreams

Field description: position of each channel of subimage

◆ outputStreamId

String 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

int 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 interfaceerated value V2TXLiveVideoResolution.

◆ videoFramerate

int videoFramerate

Field description: frame rate (fps) for the resolution of the transcoded video Value range: (0,30]; default: 15

◆ videoGOP

int videoGOP

Field description: keyframe interval (GOP) for the resolution of the transcoded video Value range: [1,8]; default value: 2 (sec)

◆ videoHeight

int 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

int 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.

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveLogLevel

class com::tencent::live2::V2TXLiveDef::V2TXLiveLogLevel

Log level.

Static Public Attributes

static final int V2TXLiveLogLevelAll = 0
 
static final int V2TXLiveLogLevelDebug = 1
 
static final int V2TXLiveLogLevelInfo = 2
 
static final int V2TXLiveLogLevelWarning = 3
 
static final int V2TXLiveLogLevelError = 4
 
static final int V2TXLiveLogLevelFatal = 5
 
static final int V2TXLiveLogLevelNULL = 6
 

Field Documentation

◆ V2TXLiveLogLevelAll

final int V2TXLiveLogLevelAll = 0
static

Output all levels of log.

◆ V2TXLiveLogLevelDebug

final int V2TXLiveLogLevelDebug = 1
static

Output DEBUG, INFO, WARNING, ERROR and FATAL level log.

◆ V2TXLiveLogLevelError

final int V2TXLiveLogLevelError = 4
static

Output ERROR and FATAL level log.

◆ V2TXLiveLogLevelFatal

final int V2TXLiveLogLevelFatal = 5
static

Only output FATAL level log.

◆ V2TXLiveLogLevelInfo

final int V2TXLiveLogLevelInfo = 2
static

Output INFO, WARNING, ERROR and FATAL level log.

◆ V2TXLiveLogLevelNULL

final int V2TXLiveLogLevelNULL = 6
static

Does not output any sdk log.

◆ V2TXLiveLogLevelWarning

final int V2TXLiveLogLevelWarning = 3
static

Output WARNING, ERROR and FATAL level log.

◆ com::tencent::live2::V2TXLiveDef::V2TXLiveLogConfig

class com::tencent::live2::V2TXLiveDef::V2TXLiveLogConfig

Log configuration.

Data Fields
boolean 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: false

boolean 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: true

boolean 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: false

int logLevel

Field description: Set Log level Recommended value: Default value: V2TXLiveLogLevel.V2TXLiveLogLevelAll

String logPath

Field description: Set the storage directory of the local log, default Log storage location: Android:/sdcard/Android/data/your packagename/files/log/liteav/

◆ com::tencent::live2::V2TXLiveDef

class com::tencent::live2::V2TXLiveDef