You need to enable JavaScript to run this app.
文档中心
视频直播

视频直播

复制全文
下载 pdf
SDK API 参考
类型详情
复制全文
下载 pdf
类型详情

VeLiveVideoEncoderConfiguration
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration

推流视频编码参数。

成员函数

返回名称
VeLiveVideoResolutiongetResolution
VeLiveVideoEncoderConfigurationsetResolution
VeLiveVideoCodecgetCodec
VeLiveVideoEncoderConfigurationsetCodec
intgetBitrate
VeLiveVideoEncoderConfigurationsetBitrate
intgetMinBitrate
VeLiveVideoEncoderConfigurationsetMinBitrate
intgetMaxBitrate
VeLiveVideoEncoderConfigurationsetMaxBitrate
intgetGopSize
VeLiveVideoEncoderConfigurationsetGopSize
intgetFps
VeLiveVideoEncoderConfigurationsetFps
booleanisEnableBFrame
VeLiveVideoEncoderConfigurationsetEnableBFrame
booleanisEnableAccelerate
VeLiveVideoEncoderConfigurationsetEnableAccelerate

函数说明

getResolution

public VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getResolution()

获取推流视频分辨率。

返回值

推流视频分辨率 VeLiveVideoResolution。

setResolution

public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setResolution(VeLiveVideoResolution resolution)

设置推流视频分辨率。

传入参数

参数名类型说明
resolutionVeLiveVideoResolution推流视频分辨率,默认值为 VeLiveVideoResolution720P,详情请参见 VeLiveVideoResolution。

返回值

推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。

getCodec

public VeLiveVideoCodec com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getCodec()

获取推流视频编码格式。

返回值

推流视频编码格式,详情请参见 VeLiveVideoCodec。

setCodec

public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setCodec(VeLiveVideoCodec codec)

设置推流视频编码格式。

传入参数

参数名类型说明
codecVeLiveVideoCodec推流视频编码格式,详情请参见 VeLiveVideoCodec 。

返回值

推流视频编码参数,详见 VeLiveVideoEncoderConfiguration。

getBitrate

public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getBitrate()

获取推流视频编码码率。

返回值

推流视频编码码率。

setBitrate

public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setBitrate(int bitrate)

设置推流视频编码码率。

传入参数

参数名类型说明
bitrateint推流视频编码码率,单位为 kbps,默认值由 resolution 参数值决定。

返回值

推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。

getMinBitrate

public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getMinBitrate()

获取推流视频编码最小码率。

返回值

推流视频编码最小码率。

setMinBitrate

public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setMinBitrate(int minBitrate)

设置推流视频编码最小码率。

传入参数

参数名类型说明
minBitrateint推流视频编码最小码率,单位为 kbps,默认值由 resolution 参数值决定;如果开启自适应码率,推流 SDK 根据网络情况进行编码码率自适应调整的最小码率

返回值

推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。

getMaxBitrate

public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getMaxBitrate()

获取推流视频编码最大码率。

返回值

推流视频编码最大码率。

setMaxBitrate

public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setMaxBitrate(int maxBitrate)

设置推流视频编码最大码率。

传入参数

参数名类型说明
maxBitrateint推流视频编码最大码率,单位为 kbps,默认值由 resolution 参数值决定;如果开启自适应码率,推流 SDK 根据网络情况进行编码码率自适应调整的最大码率。

返回值

推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。

getGopSize

public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getGopSize()

获取推流视频编码 GOP。

返回值

推流视频编码 GOP。

setGopSize

public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setGopSize(int gopSize)

设置推流视频编码 GOP。

传入参数

参数名类型说明
gopSizeint视频 GOP 大小,单位为 s,默认值为 2

返回值

推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。

getFps

public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getFps()

获取推流视频编码帧率。

返回值

推流视频编码帧率。

setFps

public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setFps(int fps)

设置推流视频编码帧率。

传入参数

参数名类型说明
fpsint视频编码帧率,单位为 fps,默认值为 15

返回值

推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。

isEnableBFrame

public boolean com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.isEnableBFrame()

获取是否开启 B 帧。

返回值

是否开启B帧。

  • true:B 帧开启;
  • false:B 帧关闭。

setEnableBFrame

public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setEnableBFrame(boolean enableBFrame)

设置推流视频编码开启 B 帧。

传入参数

参数名类型说明
enableBFrameboolean是否开启 B 帧。默认为 false。
  • true:开启;
  • false:关闭。

返回值

推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。

isEnableAccelerate

public boolean com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.isEnableAccelerate()

获取是否开启硬件编码。

返回值

是否开启硬件编码。

  • true:开启;
  • false:关闭。

setEnableAccelerate

public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setEnableAccelerate(boolean enableAccelerate)

设置推流视频编码开启硬件编码。

传入参数

参数名类型说明
enableAccelerateboolean是否开启硬件编码。默认值为 true。
  • true:开启;
  • false:关闭。

返回值

推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。

VeLiveAudioCodec
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCodec

音频编码格式。

枚举值

类型值说明
VeLiveAudioCodecFdkAAC0FDKAAC 编码。
VeLiveAudioCodecMediaCodecAAC1Mediacodec AAC 编码。
VeLiveAudioCodecFFmpegAAC2FFMPEG AAC 编码。

VeLiveVideoFrame
public class com.ss.avframework.live.VeLiveVideoFrame

视频帧的数据信息。

成员函数

返回名称
VeLiveVideoFrameVeLiveVideoFrame
VeLiveVideoFrameVeLiveVideoFrame
VeLiveVideoFrameVeLiveVideoFrame
VeLiveVideoFrameVeLiveVideoFrame
voidretain
synchronized voidrelease
VeLiveVideoBufferTypegetBufferType
VeLiveVideoFramesetBufferType
VeLivePixelFormatgetPixelFormat
VeLiveVideoFramesetPixelFormat
VeLiveVideoRotationgetRotation
VeLiveVideoFramesetRotation
intgetWidth
intgetHeight
intgetRotatedWidth
intgetRotatedHeight
longgetPts
intgetTextureId
voidsetTextureId
MatrixgetTextureMatrix
VeLiveVideoFramesetTextureMatrix
ByteBuffergetBuffer
byte[]getData
RunnablegetReleaseCallback
VeLiveVideoFramesetReleaseCallback

函数说明

VeLiveVideoFrame

public com.ss.avframework.live.VeLiveVideoFrame.VeLiveVideoFrame()

无参数视频帧初始化方法,适用于需要先创建一个空的视频帧对象,然后通过其他方法进行设置的场景。

VeLiveVideoFrame

public com.ss.avframework.live.VeLiveVideoFrame.VeLiveVideoFrame(
    int width,
    int height,
    long pts,
    int texId,
    boolean isOes,
    Matrix matrix
)

基于纹理 ID 的视频帧初始化方法,适用于需要通过 OpenGL 纹理进行视频渲染的场景,包含纹理 ID、是否为 OES 纹理以及纹理矩阵的详细信息。

传入参数

参数名类型说明
widthint视频帧的宽度,单位为 px。
heightint视频帧的高度,单位为 px。
ptslong视频帧的时间戳,单位为 µs。
texIdint纹理 ID。
isOesboolean是否是 OES 纹理。
matrixMatrix纹理矩阵。

VeLiveVideoFrame

public com.ss.avframework.live.VeLiveVideoFrame.VeLiveVideoFrame(
    int width,
    int height,
    long pts,
    ByteBuffer byteBuffer
)

基于 ByteBuffer 的视频帧初始化方法,适用于视频数据以 ByteBuffer 格式存储的场景,通常用于高效内存处理和直接操作字节流的应用。

传入参数

参数名类型说明
widthint视频帧的宽度,单位为 px。
heightint视频帧的高度,单位为 px。
ptslong视频帧的时间戳,单位为 µs。
byteBufferByteBufferByteBuffer 格式的视频数据,ByteBuffer 默认为 I420 格式,如果您的视频数据为其他格式,可通过调用 setPixelFormat 方法设置。

注意

调用该方法时,需要保证 YUV 数据的 stride 等于 width。

VeLiveVideoFrame

public com.ss.avframework.live.VeLiveVideoFrame.VeLiveVideoFrame(
    int width,
    int height,
    long pts,
    byte[] data
)

基于 byte[] 数组的视频帧初始化方法,适用于视频数据以 byte[] 数组格式存储的场景,通常用于直接使用字节数组处理视频帧。

传入参数

参数名类型说明
widthint视频帧的宽度,单位为 px。
heightint视频帧的高度,单位为 px。
ptslong视频帧的时间戳,单位为 µs。
databyte[]byte[] 格式的视频数据,默认为 I420 格式,如果您的视频数据为其他格式,可通过调用 setPixelFormat 方法设置。

注意

调用该方法时,需要保证 YUV 数据的 stride 等于 width。

retain

public void com.ss.avframework.live.VeLiveVideoFrame.retain()

增加 VeLiveVideoFrame 对象的引用计数。当您需要继续使用 VeLiveVideoFrame 对象时,请调用此方法将引用计数增加 1。

release

public synchronized void com.ss.avframework.live.VeLiveVideoFrame.release()

释放对 VeLiveVideoFrame 对象的引用。在您不再需要使用 VeLiveVideoFrame 对象时,应调用此方法将引用计数减少 1。当引用计数减少到零,表示不再有引用指向该对象,可以安全地释放或销毁该对象。

getBufferType

public VeLiveVideoBufferType com.ss.avframework.live.VeLiveVideoFrame.getBufferType()

获取视频数据类型。

返回值

视频数据类型,详情请参见 VeLiveVideoBufferType。

setBufferType

public VeLiveVideoFrame com.ss.avframework.live.VeLiveVideoFrame.setBufferType(VeLiveVideoBufferType bufferType)

设置视频数据类型。

传入参数

参数名类型说明
bufferTypeVeLiveVideoBufferType视频数据类型,详情请参见 VeLiveVideoBufferType。

返回值

视频帧对象,详情请参见 VeLiveVideoFrame。

getPixelFormat

public VeLivePixelFormat com.ss.avframework.live.VeLiveVideoFrame.getPixelFormat()

获取视频像素格式。

返回值

视频像素格式,详情请参见 VeLivePixelFormat。

setPixelFormat

public VeLiveVideoFrame com.ss.avframework.live.VeLiveVideoFrame.setPixelFormat(VeLivePixelFormat pixelFormat)

设置视频像素格式。

传入参数

参数名类型说明
pixelFormatVeLivePixelFormat视频像素格式,详情请参见 VeLivePixelFormat。

返回值

视频帧对象,详情请参见 VeLiveVideoFrame。

getRotation

public VeLiveVideoRotation com.ss.avframework.live.VeLiveVideoFrame.getRotation()

获取视频帧旋转角度。

返回值

视频帧旋转角度,详情请参见 VeLiveVideoRotation。

setRotation

public VeLiveVideoFrame com.ss.avframework.live.VeLiveVideoFrame.setRotation(VeLiveVideoRotation rotation)

设置视频帧旋转角度。

传入参数

参数名类型说明
rotationVeLiveVideoRotation视频帧旋转角度,详情请参见 VeLiveVideoRotation。

返回值

视频帧对象,详情请参见 VeLiveVideoFrame。

getWidth

public int com.ss.avframework.live.VeLiveVideoFrame.getWidth()

获取视频帧宽度。

返回值

视频帧宽度。

getHeight

public int com.ss.avframework.live.VeLiveVideoFrame.getHeight()

获取视频帧高度。

返回值

视频帧高度。

getRotatedWidth

public int com.ss.avframework.live.VeLiveVideoFrame.getRotatedWidth()

获取带旋转角度的视频帧宽度。

返回值

带旋转角度的视频帧宽度。

getRotatedHeight

public int com.ss.avframework.live.VeLiveVideoFrame.getRotatedHeight()

获取带旋转角度的视频帧高度。

返回值

带旋转角度的视频帧高度。

getPts

public long com.ss.avframework.live.VeLiveVideoFrame.getPts()

获取视频帧时间戳。

返回值

视频帧时间戳,单位为 μs。

getTextureId

public int com.ss.avframework.live.VeLiveVideoFrame.getTextureId()

获取视频帧纹理 ID。

返回值

视频帧纹理 ID。

setTextureId

public void com.ss.avframework.live.VeLiveVideoFrame.setTextureId(int textureId)

设置当前视频帧的纹理 ID,用于在图像渲染过程中标识 GPU 中的纹理资源。

传入参数

参数名类型说明
textureIdint纹理 ID,用于标识当前帧绑定的纹理资源。

getTextureMatrix

public Matrix com.ss.avframework.live.VeLiveVideoFrame.getTextureMatrix()

获取当前视频帧的纹理变换矩阵。该矩阵用于对纹理坐标进行变换,例如旋转、缩放或翻转操作。

返回值

一个 Matrix 对象,表示当前帧的纹理变换矩阵。

setTextureMatrix

public VeLiveVideoFrame com.ss.avframework.live.VeLiveVideoFrame.setTextureMatrix(Matrix matrix)

设置当前视频帧的纹理变换矩阵。用于在渲染前对图像纹理进行几何变换。

传入参数

参数名类型说明
matrixMatrix纹理变换矩阵。

返回值

VeLiveVideoFrame 实例,支持链式调用。

getBuffer

public ByteBuffer com.ss.avframework.live.VeLiveVideoFrame.getBuffer()

获取 ByteBuffer 格式的视频数据。

返回值

ByteBuffer 格式的视频数据。

getData

public byte[] com.ss.avframework.live.VeLiveVideoFrame.getData()

获取 byte[] 格式的视频数据。

返回值

byte[] 格式的视频数据。

getReleaseCallback

public Runnable com.ss.avframework.live.VeLiveVideoFrame.getReleaseCallback()

获取视频帧内部销毁回调。

返回值

视频帧内部销毁回调。

setReleaseCallback

public VeLiveVideoFrame com.ss.avframework.live.VeLiveVideoFrame.setReleaseCallback(Runnable releaseCallback)

设置视频帧内部销毁回调。

传入参数

参数名类型说明
releaseCallbackRunnable视频帧内部销毁回调

返回值

视频帧对象,详情请参见 VeLiveVideoFrame。

VeLiveVideoCodec
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCodec

视频编码格式。

枚举值

类型值说明
VeLiveVideoCodecH264h264使用 H.264 视频编码。
VeLiveVideoCodecByteVC1bytevc1使用火山引擎自研 ByteVC1 视频编码。

VeLivePusherStatistics
public static class com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics

推流周期性统计信息。

成员变量

类型默认值名称
int-encodeWidth
int-encodeHeight
int-captureWidth
int-captureHeight
double-captureFps
double-encodeFps
double-transportFps
int-fps
int-videoBitrate
int-minVideoBitrate
int-maxVideoBitrate
double-encodeVideoBitrate
double-transportVideoBitrate
double-encodeAudioBitrate
String-url
String-codec

变量说明

encodeWidth

public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.encodeWidth

视频编码宽度,单位为 px。

encodeHeight

public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.encodeHeight

视频编码高度,单位为 px。

captureWidth

public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.captureWidth

视频采集宽度,单位为 px。

captureHeight

public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.captureHeight

视频采集高度,单位为 px。

captureFps

public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.captureFps

视频采集帧率,单位为 fps。

encodeFps

public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.encodeFps

视频编码帧率,单位为 fps。

transportFps

public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.transportFps

视频发送帧率,可用展示实时帧率,单位为 fps。

fps

public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.fps

视频推流帧率,即您通过 setVideoEncoderConfiguration 方法设置的帧率,单位为 fps。

videoBitrate

public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.videoBitrate

视频推流码率,即您通过 setVideoEncoderConfiguration 方法设置的码率,单位为 kbps。

minVideoBitrate

public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.minVideoBitrate

视频推流最小码率,即您通过 setVideoEncoderConfiguration 方法设置的最小码率,单位为 kbps。

maxVideoBitrate

public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.maxVideoBitrate

视频推流最大码率,即您通过 setVideoEncoderConfiguration 方法设置的最大码率,单位为 kbps。

encodeVideoBitrate

public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.encodeVideoBitrate

视频编码码率,单位为 kbps。

transportVideoBitrate

public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.transportVideoBitrate

视频发送码率,可用于展示实时码率,单位为 kbps。

encodeAudioBitrate

public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.encodeAudioBitrate

音频编码码率,单位为 kbps。

url

public String com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.url

推流地址。

codec

public String com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.codec

视频编码格式。

VeLivePusherRenderMode
public enum com.ss.avframework.live.VeLivePusherDef.VeLivePusherRenderMode

推流渲染模式。

枚举值

类型值说明
VeLivePusherRenderModeFill0视频帧自适应画布。视频帧非等比缩放,直至画布被填满。在此过程中,视频帧的长宽比例可能会发生变化。
VeLivePusherRenderModeFit1视频帧内容全部显示优先。视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成背景颜色。
VeLivePusherRenderModeHidden2视窗填满优先。视频帧等比缩放,直至视窗被视频填满。如果视频帧长宽比例与视窗不同,视频帧的多出部分将无法显示。

VeLiveVideoEffectLicenseType
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseType

视频特效的许可证认证方式。

枚举值

类型值说明
VeLiveVideoEffectLicenseTypeOffLine0离线认证视频特效许可证。
VeLiveVideoEffectLicenseTypeOnLine1在线认证视频特效许可证。

VeLiveAudioBufferType
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioBufferType

推流音频数据类型。

枚举值

类型值说明
VeLiveAudioBufferTypeUnknown0未知的音频数据类型。
VeLiveAudioBufferTypeByteBuffer1ByteBuffer 音频数据类型。

VeLiveAudioChannel
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioChannel

推流音频声道数,决定音频的立体感。

枚举值

类型值说明
VeLiveAudioChannelMono1单声道,适用于语音通信,节省带宽。
VeLiveAudioChannelStereo2立体声,适用于音乐播放,提供更丰富的音频体验。

VeLiveFirstFrameType
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveFirstFrameType

定义了推流中首帧的类型,包括音视频的采集首帧、渲染首帧、编码完成首帧和发送首帧。

枚举值

类型值说明
VeLiveFirstCaptureFrame0视频/音频采集首帧,采集首帧是从音频设备或视频设备(如麦克风、摄像头)获取的第一帧数据。
VeLiveFirstRenderFrame1视频渲染首帧,渲染首帧是在渲染过程中在屏幕上显示的第一帧视频数据。
VeLiveFirstEncodedFrame2视频/音频编码完成首帧,编码完成首帧是编码为某种特定格式的第一帧数据。
VeLiveFirstSendFrame3视频/音频发送首帧,发送首帧是在发送过程中,通过网络传输的第一帧数据。

VeLiveVideoCaptureType
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureType

视频采集类型。

枚举值

类型值说明
VeLiveVideoCaptureFrontCamera0使用前置摄像头进行视频采集。
VeLiveVideoCaptureBackCamera1使用后置摄像头进行视频采集。
VeLiveVideoCaptureScreen2使用屏幕采集。
VeLiveVideoCaptureExternal3使用外部设备或源进行视频采集。
VeLiveVideoCaptureCustomImage4使用指定的静态图片作为视频源。
VeLiveVideoCaptureLastFrame5使用最近采集的一帧图像重复作为视频源。
VeLiveVideoCaptureDummyFrame6使用黑色帧作为视频源,一般用于调试或特殊需求。

VeLiveVideoProfile
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoProfile

相机视频配置枚举类。用于设置相机的视频配置参数,包括视频编码格式和参数等。

枚举值

类型值说明
VeLiveVideoProfileUnknown0未知的视频配置类型。
VeLiveVideoProfileH264Baseline1H.264 编码配置,使用 Baseline 级别。
VeLiveVideoProfileH264Main2H.264 编码配置,使用 Main 级别。
VeLiveVideoProfileH264High3H.264 编码配置,使用 High 级别。
VeLiveVideoProfileByteVC1Main4ByteVC1 编码配置,使用 Main 级别。

VeLiveVideoRotation
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoRotation

视频帧旋转角度。以 App 方向为旋转参考系。

枚举值

类型值说明
VeLiveVideoRotation00不旋转。
VeLiveVideoRotation9090顺时针旋转 90 度。
VeLiveVideoRotation180180顺时针旋转 180 度。
VeLiveVideoRotation270270顺时针旋转 270 度。

VeLiveVideoFrameSource
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameSource

视频帧来源。

成员变量

类型默认值名称
int1VeLiveVideoFrameSourceCapture
int1 << 1VeLiveVideoFrameSourcePreEncode

成员函数

返回名称
VeLiveVideoFrameSourceVeLiveVideoFrameSource

变量说明

VeLiveVideoFrameSourceCapture

public static final int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameSource.VeLiveVideoFrameSourceCapture = 1

采集到的原始视频帧。这是从设备的摄像头或其他视频输入源获取的视频帧。

VeLiveVideoFrameSourcePreEncode

public static final int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameSource.VeLiveVideoFrameSourcePreEncode = 1 << 1

编码前的视频帧。这是通过各种处理(例如滤镜、旋转等)后,准备进行编码的视频帧。

函数说明

VeLiveVideoFrameSource

public com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameSource.VeLiveVideoFrameSource(int source)

创建一个视频帧源对象。

传入参数

参数名类型说明
sourceint视频帧源标识。当取值为 VeLiveVideoFrameSourceCapture | VeLiveVideoFrameSourcePreEncode 时,表示同时订阅 VeLiveVideoFrameSourceCapture 和 VeLiveVideoFrameSourcePreEncode 2 种类型。

VeLiveAudioProfile
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioProfile

AAC 音频编码档位。

枚举值

类型值说明
VeLiveAudioAACProfileLC0LC-AAC 编码方式。
VeLiveAudioAACProfileHEv11HEv1-AAC 编码方式。
VeLiveAudioAACProfileHEv22HEv2-AAC 编码方式。

VeLiveVideoBufferType
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoBufferType

推流视频数据类型。

枚举值

类型值说明
VeLiveVideoBufferTypeUnknown0未知视频数据类型,当未指定输入视频数据的格式时,会默认为此类型。
VeLiveVideoBufferTypeTexture1视频数据类型为 OpenGL 纹理。
VeLiveVideoBufferTypeByteBuffer2视频数据类型为 ByteBuffer 类型。
VeLiveVideoBufferTypeByteArray3视频数据类型为 ByteArray 类型。

VeLiveAudioCaptureConfiguration
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureConfiguration

音频采集配置。

成员函数

返回名称
VeLiveAudioSampleRategetSampleRate
VeLiveAudioCaptureConfigurationsetSampleRate
VeLiveAudioChannelgetChannel
VeLiveAudioCaptureConfigurationsetChannel

函数说明

getSampleRate

public VeLiveAudioSampleRate com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureConfiguration.getSampleRate()

获取采集音频采样率。

返回值

音频采样率,详情请参见 VeLiveAudioSampleRate。

setSampleRate

public VeLiveAudioCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureConfiguration.setSampleRate(VeLiveAudioSampleRate sampleRate)

设置采集音频采样率。

传入参数

参数名类型说明
sampleRateVeLiveAudioSampleRate音频采样率,默认值为 VeLiveAudioSampleRate44100,详情请参见 VeLiveAudioSampleRate。

返回值

推流音频采集参数配置对象,详情请参见 VeLiveAudioCaptureConfiguration。

getChannel

public VeLiveAudioChannel com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureConfiguration.getChannel()

获取采集音频声道数。

返回值

音频声道数,详情请参见 VeLiveAudioChannel。

setChannel

public VeLiveAudioCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureConfiguration.setChannel(VeLiveAudioChannel channel)

设置采集音频声道数。

传入参数

参数名类型说明
channelVeLiveAudioChannel音频声道数,默认值为 VeLiveAudioChannelStereo,详情请参见 VeLiveAudioChannel

返回值

推流音频采集参数配置对象,详情请参见 VeLiveAudioCaptureConfiguration。

VeLiveStreamMixDescription
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveStreamMixDescription

音视频混流布局。包含了视频混流布局、音频混流布局和画布背景色等属性。

成员变量

类型默认值名称
ArrayList<VeLiveMixVideoLayout>new ArrayList<>()mixVideoStreams
ArrayList<VeLiveMixAudioLayout>new ArrayList<>()mixAudioStreams
String"#000000"backgroundColor

变量说明

mixVideoStreams

public final ArrayList<VeLiveMixVideoLayout> com.ss.avframework.live.VeLivePusherDef.VeLiveStreamMixDescription.mixVideoStreams = new ArrayList<>()

视频混流布局设置的数组,其中每个元素代表一路视频流的布局。详情请参见 VeLiveMixVideoLayout。

mixAudioStreams

public final ArrayList<VeLiveMixAudioLayout> com.ss.avframework.live.VeLivePusherDef.VeLiveStreamMixDescription.mixAudioStreams = new ArrayList<>()

音频混流设置的数组,其中每个元素代表一路音频流的。详情请参见 VeLiveMixAudioLayout。

backgroundColor

public String com.ss.avframework.live.VeLivePusherDef.VeLiveStreamMixDescription.backgroundColor = "#000000"

视频混流画布的背景色设置,采用 #RRGGBB 格式。

VeLiveAudioSampleRate
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioSampleRate

推流音频采样率。

枚举值

类型值说明
VeLiveAudioSampleRate800080008k 采样。
VeLiveAudioSampleRate160001600016k 采样。
VeLiveAudioSampleRate320003200032k 采样。
VeLiveAudioSampleRate441004410044.1k 采样。
VeLiveAudioSampleRate480004800048k 采样。

VeLiveAudioPowerLevel
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioPowerLevel

音量等级,用于评估和控制音频的响度。

枚举值

类型值说明
VeLiveAudioPowerLevelSilent0无声,音量 ≤1db。
VeLiveAudioPowerLevelQuiet1安静,音量 15db 以下。
VeLiveAudioPowerLevelLight2轻声,接近耳语音量,音量为 16db~30db 之间。
VeLiveAudioPowerLevelNormal3正常,音量适宜,类似正常对话的音量,音量为 30db~60db 之间。
VeLiveAudioPowerLevelLoud4较大,音量较高,类似咖啡馆、餐厅的环境噪音,音量为 61db~85db 之间。
VeLiveAudioPowerLevelNoise5吵闹,音量极高,类似于繁忙的街道或者是音乐会现场,音量超过 85db。

VeLiveVideoCaptureConfiguration
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration

视频采集配置。

成员函数

返回名称
intgetWidth
VeLiveVideoCaptureConfigurationsetWidth
intgetHeight
VeLiveVideoCaptureConfigurationsetHeight
intgetFps
VeLiveVideoCaptureConfigurationsetFps
VeLiveVideoCaptureConfigurationsetDefaultFrontCameraMirrored
booleanisDefaultFrontCameraMirrored

函数说明

getWidth

public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.getWidth()

获取采集视频宽度。

返回值

采集视频宽度。

setWidth

public VeLiveVideoCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.setWidth(int width)

设置采集视频宽度。

传入参数

参数名类型说明
widthint采集视频宽度,默认值为 720。

返回值

推流视频采集参数配置对象,详情请参见 VeLiveVideoCaptureConfiguration。

getHeight

public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.getHeight()

获取采集视频高度。

返回值

采集视频高度。

setHeight

public VeLiveVideoCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.setHeight(int height)

设置采集视频高度。

传入参数

参数名类型说明
heightint采集视频高度,默认值为 1280。

返回值

推流视频采集参数配置对象,详情请参见 VeLiveVideoCaptureConfiguration。

getFps

public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.getFps()

获取采集视频帧率。

返回值

采集视频帧率。

setFps

public VeLiveVideoCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.setFps(int fps)

设置采集视频帧率。

传入参数

参数名类型说明
fpsint采集视频帧率,默认值为 15。

返回值

推流视频采集参数配置对象,详情请参见 VeLiveVideoCaptureConfiguration。

setDefaultFrontCameraMirrored

public VeLiveVideoCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.setDefaultFrontCameraMirrored(boolean mirror)

设置前置摄像头采集时,是否默认为镜像状态。

传入参数

参数名类型说明
mirrorboolean前置摄像头采集时,是否默认为镜像状态。默认值为 true。取值如下:
  • true:镜像状态。适用于视频通话等用户习惯看到镜像画面的场景。
  • false:非镜像状态。适用于教学演示、白板书写等需要观众看到真实方向的场景。

返回值

视频采集配置。详情请参见 VeLiveVideoCaptureConfiguration。

isDefaultFrontCameraMirrored

public boolean com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.isDefaultFrontCameraMirrored()

获取前置摄像头采集时的默认镜像状态。适用于需要确认前置摄像头默认镜像状态的场景,例如主播在直播前确认初始预览画面是否符合预期。

返回值

前置摄像头采集时的默认镜像状态。

  • true:镜像状态。
  • false:非镜像状态。
VeLivePixelFormat
public enum com.ss.avframework.live.VeLivePusherDef.VeLivePixelFormat

视频帧的数据格式。

枚举值

类型值说明
VeLivePixelFormatUnknown0未知格式。
VeLivePixelFormatI4201I420 格式。
VeLivePixelFormatNV122NV12 格式。
VeLivePixelFormatNV213NV21 格式。
VeLivePixelFormat2DTexture42D 纹理格式。
VeLivePixelFormatOesTexture5OES 纹理格式。

VeLivePusherStatus
public enum com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatus

推流器与服务器的连接状态。

枚举值

类型值说明
VeLivePushStatusNone0初始状态。
VeLivePushStatusConnecting1正在连接服务器。
VeLivePushStatusConnectSuccess2连接服务器成功。
VeLivePushStatusReconnecting3重连服务器中。
VeLivePushStatusConnectStop4推流连接被终止。
VeLivePushStatusConnectError5推流连接失败。
VeLivePushStatusDisconnected6与服务器断开连接。

VeLiveVideoResolution
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution

推流视频分辨率档位枚举值。

成员变量

类型默认值名称
VeLiveVideoResolutionnewVeLiveVideoResolution(360, 640, 15, 500, 250, 800)VeLiveVideoResolution360P
VeLiveVideoResolutionnewVeLiveVideoResolution(480, 864, 15, 800, 320, 1266)VeLiveVideoResolution480P
VeLiveVideoResolutionnewVeLiveVideoResolution(540, 960, 15, 1000, 500, 1520)VeLiveVideoResolution540P
VeLiveVideoResolutionnewVeLiveVideoResolution(720, 1280, 15, 1200, 800, 1900)VeLiveVideoResolution720P
VeLiveVideoResolutionnewVeLiveVideoResolution(1080, 1920, 20, 2500, 1000, 3800)VeLiveVideoResolution1080P

变量说明

VeLiveVideoResolution360P

public static final VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution.VeLiveVideoResolution360P = newVeLiveVideoResolution(360, 640, 15, 500, 250, 800)

360P 分辨率。档位详细配置如下所示。

  • 横屏分辨率:640x360
  • 竖屏分辨率:360x640
  • 帧率:15fps
  • 目标码率:500kbps
  • 最小码率:250kbps
  • 最大码率:800kbps

VeLiveVideoResolution480P

public static final VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution.VeLiveVideoResolution480P = newVeLiveVideoResolution(480, 864, 15, 800, 320, 1266)

480P 分辨率。档位详细配置如下所示。

  • 横屏分辨率:864x480
  • 竖屏分辨率:480x864
  • 帧率:15fps
  • 目标码率:800kbps
  • 最小码率:320kbps
  • 最大码率:1266kbps

VeLiveVideoResolution540P

public static final VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution.VeLiveVideoResolution540P = newVeLiveVideoResolution(540, 960, 15, 1000, 500, 1520)

540P 分辨率。档位详细配置如下所示。

  • 横屏 960x540
  • 竖屏 540x960
  • 帧率:15fps
  • 目标码率:1000kbps
  • 最小码率:500kbps
  • 最大码率:1520kbps

VeLiveVideoResolution720P

public static final VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution.VeLiveVideoResolution720P = newVeLiveVideoResolution(720, 1280, 15, 1200, 800, 1900)

720P 分辨率。档位详细配置如下所示。

  • 横屏 1280x720
  • 竖屏 720x1280
  • 帧率:15fps
  • 目标码率:1200kbps
  • 最小码率:800kbps
  • 最大码率:1900kbps

VeLiveVideoResolution1080P

public static final VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution.VeLiveVideoResolution1080P = newVeLiveVideoResolution(1080, 1920, 20, 2500, 1000, 3800)

1080P 分辨率。档位详细配置如下所示。

  • 横屏 1920x1080
  • 竖屏 1080x1920
  • 帧率:20 fps
  • 目标码率:2500kbps
  • 最小码率:1000kbps
  • 最大码率:3800kbps
VeLiveAudioFrame
public class com.ss.avframework.live.VeLiveAudioFrame

音频帧的数据信息。

成员函数

返回名称
VeLiveAudioFrameVeLiveAudioFrame
VeLiveAudioBufferTypegetBufferType
VeLiveAudioSampleRategetSampleRate
VeLiveAudioChannelgetChannels
intgetSamplesPerChannel
longgetPts
ByteBuffergetBuffer

函数说明

VeLiveAudioFrame

public com.ss.avframework.live.VeLiveAudioFrame.VeLiveAudioFrame(
    VeLiveAudioSampleRate sampleRate,
    VeLiveAudioChannel channel,
    long pts,
    ByteBuffer buffer
)

音频帧初始化方法。

传入参数

参数名类型说明
sampleRateVeLiveAudioSampleRate音频采样率。详情请参见 VeLiveAudioSampleRate。
channelVeLiveAudioChannel音频声道数。详情请参见 VeLiveAudioChannel。
ptslong音频时间戳,单位为 μs。
bufferByteBufferByteBuffer 格式的音频数据。

getBufferType

public VeLiveAudioBufferType com.ss.avframework.live.VeLiveAudioFrame.getBufferType()

获取音频数据类型。

返回值

音频数据类型,详情请参见 VeLiveAudioBufferType。

getSampleRate

public VeLiveAudioSampleRate com.ss.avframework.live.VeLiveAudioFrame.getSampleRate()

获取音频采样率。

返回值

音频采样率,详情请参见 VeLiveAudioSampleRate。

getChannels

public VeLiveAudioChannel com.ss.avframework.live.VeLiveAudioFrame.getChannels()

获取音频声道数。

返回值

音频声道数,详情请参见 VeLiveAudioChannel。

getSamplesPerChannel

public int com.ss.avframework.live.VeLiveAudioFrame.getSamplesPerChannel()

获取每个声道的采样点数。

返回值

采样点数。

getPts

public long com.ss.avframework.live.VeLiveAudioFrame.getPts()

获取音频时间戳,单位为 μs。

返回值

音频时间戳,单位为 μs。

getBuffer

public ByteBuffer com.ss.avframework.live.VeLiveAudioFrame.getBuffer()

获取音频数据。音频帧数据为小端字节序存储。

返回值

格式为 ByteBuffer 的音频数据。

VeLiveNetworkQuality
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveNetworkQuality

网络质量/状态。

枚举值

类型值说明
VeLiveNetworkQualityUnknown0未查询到网络状态。
VeLiveNetworkQualityBad1网络差。
VeLiveNetworkQualityPoor2网络一般。
VeLiveNetworkQualityGood3网络状态佳。

VeLivePusherLogLevel
public enum com.ss.avframework.live.VeLivePusherDef.VeLivePusherLogLevel

输出的日志级别。

枚举值

类型值说明
VeLiveLogLevelVerboseAVLog.VERBOSE输出 VERBOSE、DEBUG、INFO、WARNING 和 ERROR 级别的日志。
VeLiveLogLevelDebugAVLog.DEBUG输出 DEBUG、INFO、WARNING 和 ERROR 级别的日志。
VeLiveLogLevelInfoAVLog.INFO输出 INFO、WARNING 和 ERROR 级别的日志。
VeLiveLogLevelWarnAVLog.WARN输出 WARNING 和 ERROR 级别的日志。
VeLiveLogLevelErrorAVLog.ERROR输出 ERROR 级别的日志。
VeLiveLogLevelNoneAVLog.NONE关闭日志。

VeLiveAudioBitDepth
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioBitDepth

推流音频位深度。

枚举值

类型值说明
VeLiveAudioBitDepth161616bit 位深度。

VeLiveMixAudioLayout
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveMixAudioLayout

音频混流设置。

成员变量

类型默认值名称
int-1streamId
float1.0fvolume

成员函数

返回名称
voidupdate

变量说明

streamId

public int com.ss.avframework.live.VeLivePusherDef.VeLiveMixAudioLayout.streamId = -1

音频流 ID,唯一标识,用于区分不同的音频流。

volume

public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixAudioLayout.volume = 1.0f

混流音频的音量,范围为 [0.0,4.0]。当您将 VeLiveAudioMixType 设置为 VeLiveAudioMixPlayAndPush 时,该变量同时控制混流音频在拉流端和本地的播放音量。

函数说明

update

public void com.ss.avframework.live.VeLivePusherDef.VeLiveMixAudioLayout.update(VeLiveMixAudioLayout other)

更新音频混流设置。

传入参数

参数名类型说明
otherVeLiveMixAudioLayout新的音频混流设置,详情请参见 VeLiveMixAudioLayout。

VeLivePusherConfiguration
public class com.ss.avframework.live.VeLivePusherConfiguration

推流引擎初始化配置。

成员函数

返回名称
VeLivePusherConfigurationsetReconnectIntervalSeconds
intgetReconnectIntervalSeconds
VeLivePusherConfigurationsetReconnectCount
intgetReconnectCount
VeLivePusherConfigurationsetVideoCaptureConfig
VeLiveVideoCaptureConfigurationgetVideoCaptureConfig
VeLivePusherConfigurationsetAudioCaptureConfig
VeLiveAudioCaptureConfigurationgetAudioCaptureConfig
VeLivePusherConfigurationsetContext
ContextgetContext
VeLivePusherConfigurationsetExtraParameters
LiveSdkSettinggetExtraParams
VeLivePusherbuild

函数说明

setReconnectIntervalSeconds

public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setReconnectIntervalSeconds(int interval)

设置推流器推流失败后尝试重连的时间间隔。

传入参数

参数名类型说明
intervalint时间间隔,单位为 s,默认值为 5

getReconnectIntervalSeconds

public int com.ss.avframework.live.VeLivePusherConfiguration.getReconnectIntervalSeconds()

获取推流器推流失败后尝试重连的时间间隔。

返回值

时间间隔,单位为 s。

setReconnectCount

public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setReconnectCount(int maxCount)

设置推流器推流失败后尝试重连的次数。

传入参数

参数名类型说明
maxCountint重连次数,默认值为 3

getReconnectCount

public int com.ss.avframework.live.VeLivePusherConfiguration.getReconnectCount()

获取推流器推流失败后尝试重连的次数。

返回值

重连次数。

setVideoCaptureConfig

public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setVideoCaptureConfig(VeLiveVideoCaptureConfiguration config)

设置视频采集参数,用于调整和设置视频采集相关的参数。

传入参数

参数名类型说明
configVeLiveVideoCaptureConfiguration视频采集参数,详情请参见 VeLiveVideoCaptureConfiguration。

返回值

推流引擎初始化配置对象,详情请参见 VeLivePusherConfiguration。

getVideoCaptureConfig

public VeLiveVideoCaptureConfiguration com.ss.avframework.live.VeLivePusherConfiguration.getVideoCaptureConfig()

获取视频采集参数,用于调整和设置视频采集相关的参数。

返回值

视频采集参数配置对象,详情请参见 VeLiveVideoCaptureConfiguration。

setAudioCaptureConfig

public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setAudioCaptureConfig(VeLiveAudioCaptureConfiguration config)

设置音频采集参数,用于调整和设置音频采集相关的参数。

传入参数

参数名类型说明
configVeLiveAudioCaptureConfiguration音频采集参数,详情请参见 VeLiveAudioCaptureConfiguration。

返回值

推流引擎初始化配置对象,详情请参见 VeLiveAudioCaptureConfiguration。

getAudioCaptureConfig

public VeLiveAudioCaptureConfiguration com.ss.avframework.live.VeLivePusherConfiguration.getAudioCaptureConfig()

获取音频采集参数,用于调整和设置音频采集相关的参数。

返回值

音频采集参数配置对象,详情请参见 VeLiveAudioCaptureConfiguration。

setContext

public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setContext(Context context)

设置应用上下文。

传入参数

参数名类型说明
contextContext应用上下文。

返回值

推流引擎初始化配置对象,详情请参见 VeLivePusherConfiguration。

getContext

public Context com.ss.avframework.live.VeLivePusherConfiguration.getContext()

获取应用上下文。

返回值

应用上下文。

setExtraParameters

public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setExtraParameters(String params)

设置扩展参数,默认不需要设置。如果需要使用,您可通过提交工单联系技术支持。

传入参数

参数名类型说明
paramsString扩展参数。

返回值

推流引擎初始化配置对象,详情请参见 VeLivePusherConfiguration。

getExtraParams

public LiveSdkSetting com.ss.avframework.live.VeLivePusherConfiguration.getExtraParams()

获取扩展参数。

返回值

扩展参数。

build

public VeLivePusher com.ss.avframework.live.VeLivePusherConfiguration.build()

构造推流引擎。

返回值

推流引擎,详情请参见 VeLivePusher。

VeLiveOrientation
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveOrientation

推流横竖屏模式。

枚举值

类型值说明
VeLiveOrientationLandscape0横屏模式。
VeLiveOrientationPortrait1竖屏模式。

VeLiveVideoMirrorType
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoMirrorType

视频镜像类型。

枚举值

类型值说明
VeLiveVideoMirrorCapture0对采集画面的镜像控制。开启时,预览和推流画面都会呈现为镜像状态。
VeLiveVideoMirrorPreview1对预览画面的镜像控制。开启时,只有主播预览画面呈现镜像状态。
VeLiveVideoMirrorPushStream2对编码前画面的镜像控制。开启时,主播推流画面呈现镜像状态。

VeLiveFileRecorderConfiguration
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration

推流本地文件录制配置。

成员函数

返回名称
intgetWidth
VeLiveFileRecorderConfigurationsetWidth
intgetHeight
VeLiveFileRecorderConfigurationsetHeight
intgetFps
VeLiveFileRecorderConfigurationsetFps
intgetBitrate
VeLiveFileRecorderConfigurationsetBitrate

函数说明

getWidth

public int com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.getWidth()

获取录制视频宽度。

返回值

录制视频宽度。

setWidth

public VeLiveFileRecorderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.setWidth(int width)

设置录制视频宽度。

传入参数

参数名类型说明
widthint录制视频宽度,默认值为 360

返回值

推流本地文件录制配置对象,详情请参见 VeLiveFileRecorderConfiguration。

getHeight

public int com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.getHeight()

获取录制视频高度。

返回值

录制视频高度。

setHeight

public VeLiveFileRecorderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.setHeight(int height)

设置录制视频高度。

传入参数

参数名类型说明
heightint录制视频宽度,默认值为 640。

返回值

推流本地文件录制配置对象,详情请参见 VeLiveFileRecorderConfiguration。

getFps

public int com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.getFps()

获取录制视频帧率。

返回值

录制视频帧率。

setFps

public VeLiveFileRecorderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.setFps(int fps)

设置录制视频帧率。

传入参数

参数名类型说明
fpsint录制视频帧率,默认值为 15。

返回值

推流本地文件录制配置对象,详情请参见 VeLiveFileRecorderConfiguration。

getBitrate

public int com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.getBitrate()

获取录制视频码率。

返回值

录制视频码率。

setBitrate

public VeLiveFileRecorderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.setBitrate(int bitrate)

设置录制视频码率。

传入参数

参数名类型说明
bitrateint录制视频码率,单位为 kbps,默认值为 2000。

返回值

推流本地文件录制配置对象,详情请参见 VeLiveFileRecorderConfiguration。

VeLiveMixVideoLayout
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout

视频混流设置。

成员变量

类型默认值名称
int-1streamId
float0x
float0y
float1width
float1height
float1alpha
int0zOrder
VeLivePusherRenderModeVeLivePusherRenderMode.VeLivePusherRenderModeFillrenderMode
booleantrueenableAlpha

成员函数

返回名称
voidupdate

变量说明

streamId

public int com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.streamId = -1

视频流 ID,唯一标识,用于区分不同的视频流。

x

public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.x = 0

视频流对应区域左上角的横坐标,该坐标是相对整体画面的归一化比例,取值的范围为 [0.0,1.0]。

y

public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.y = 0

视频流对应区域左上角的纵坐标,该坐标是相对整体画面的归一化比例,取值的范围为 [0.0,1.0]。

width

public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.width = 1

视频流对应区域宽度,该宽度是相对整体画面的归一化比例,取值的范围为 [0.0,1.0]。

height

public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.height = 1

视频流对应区域高度,该高度是相对整体画面的归一化比例,取值的范围为 [0.0,1.0]。

alpha

public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.alpha = 1

视频流在混流中的透明度,取值范围为 [0.0,1.0],取值 0.0 表示全透明,取值 1.0 表示不透明。

zOrder

public int com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.zOrder = 0

视频流在混流中的层级。取值范围为 [0,100],取值 0 表示最底层,取值越大,层级越高。

renderMode

public VeLivePusherRenderMode com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.renderMode = VeLivePusherRenderMode.VeLivePusherRenderModeFill

视频流的渲染模式。详情请参见 VeLivePusherRenderMode。

enableAlpha

public boolean com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.enableAlpha = true

是否保留视频流原 Alpha 通道值,默认为保留,当 alpha 取值在 [0.0, 1.0] 之间时,则忽略该配置。

  • YES:保留;
  • NO:不保留。

函数说明

update

public void com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.update(VeLiveMixVideoLayout other)

更新视频混流设置。

传入参数

参数名类型说明
otherVeLiveMixVideoLayout新的视频混流设置,详情请参见 VeLiveMixVideoLayout。

VeLiveVideoEffectLicenseConfiguration
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration

视频特效许可证配置。

静态函数

返回名称
static VeLiveVideoEffectLicenseConfigurationcreate
static VeLiveVideoEffectLicenseConfigurationcreate

成员函数

返回名称
VeLiveVideoEffectLicenseTypegetType
StringgetPath
StringgetKey
StringgetSecret
StringgetUrl

函数说明

create

public static VeLiveVideoEffectLicenseConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.create(String path)

初始化配置为本地验证模式。

传入参数

参数名类型说明
pathString视频特效许可证的本地缓存路径。可通过 getPath 获取。

返回值

返回 VeLiveVideoEffectLicenseConfiguration 类的实例,该实例使用指定的本地路径进行许可证验证。

create

public static VeLiveVideoEffectLicenseConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.create(
    String key,
    String secret,
    String url
)

初始化配置为在线验证模式。

传入参数

参数名类型说明
keyString视频特效许可证的在线认证 key。可通过 getKey 获取。
secretString视频特效许可证的在线认证 secret。可通过 getSecret 获取。
urlString视频特效许可证的在线认证地址,如果传入 null,可通过 getUrl 获取在线认证地址。

返回值

返回 VeLiveVideoEffectLicenseConfiguration 类的实例,该实例使用指定的 key、secret 和 url 进行在线许可证验证。

getType

public VeLiveVideoEffectLicenseType com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.getType()

获取视频特效许可证类型。

返回值

视频特效许可证类型,许可证类型请参见 VeLiveVideoEffectLicenseType。

getPath

public String com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.getPath()

获取视频特效许可证的本地路径。当 VeLiveVideoEffectLicenseType 为 VeLiveVideoEffectLicenseTypeOffLine 时,返回许可证文件的本地路径。

返回值

视频特效许可证的本地路径。

getKey

public String com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.getKey()

获取视频特效许可证的在线认证 key。当 VeLiveVideoEffectLicenseType 为 VeLiveVideoEffectLicenseTypeOnLine 时,返回在线认证的 key。

返回值

视频特效许可证的在线认证 key。

getSecret

public String com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.getSecret()

获取视频特效许可证的在线认证 secret。当 VeLiveVideoEffectLicenseType 为 VeLiveVideoEffectLicenseTypeOnLine 时,返回在线认证的 secret。

返回值

视频特效许可证的在线认证 secret。

getUrl

public String com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.getUrl()

获取视频特效许可证的在线认证地址。当 VeLiveVideoEffectLicenseType 为 VeLiveVideoEffectLicenseTypeOnLine 时,返回在线认证地址。

返回值

视频特效许可证的在线认证地址。

VeLiveAudioFrameSource
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameSource

音频帧来源。

成员变量

类型默认值名称
int1VeLiveAudioFrameSourceCapture
int1 << 1VeLiveAudioFrameSourcePreEncode

成员函数

返回名称
VeLiveAudioFrameSourceVeLiveAudioFrameSource

变量说明

VeLiveAudioFrameSourceCapture

public static final int com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameSource.VeLiveAudioFrameSourceCapture = 1

采集到的原始音频帧。这是从设备的麦克风或其他音频输入源获取的音频帧。

VeLiveAudioFrameSourcePreEncode

public static final int com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameSource.VeLiveAudioFrameSourcePreEncode = 1 << 1

编码前的音频帧。这是通过各种处理(例如噪音消除、回声消除等)后,准备进行编码的音频帧。

函数说明

VeLiveAudioFrameSource

public com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameSource.VeLiveAudioFrameSource(int source)

创建一个音频帧源对象。

传入参数

参数名类型说明
sourceint音频帧源标识,当取值为 VeLiveAudioFrameSourceCapture | VeLiveAudioFrameSourcePreEncode 时,表示同时订阅 VeLiveAudioFrameSourceCapture 和 VeLiveAudioFrameSourcePreEncode 2 种类型。

VeLiveAudioEncoderConfiguration
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration

推流音频编码参数。

成员函数

返回名称
intgetBitrate
VeLiveAudioEncoderConfigurationsetBitrate
VeLiveAudioSampleRategetSampleRate
VeLiveAudioEncoderConfigurationsetSampleRate
VeLiveAudioChannelgetChannel
VeLiveAudioEncoderConfigurationsetChannel
VeLiveAudioProfilegetProfile
VeLiveAudioEncoderConfigurationsetProfile

函数说明

getBitrate

public int com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.getBitrate()

获取推流音频编码码率。

返回值

推流音频编码码率。

setBitrate

public VeLiveAudioEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.setBitrate(int bitrate)

设置推流音频编码码率。

传入参数

参数名类型说明
bitrateint推流音频编码码率,单位为 kbps,默认值为 64。

返回值

推流音频编码参数配置对象,详情请参见 。

getSampleRate

public VeLiveAudioSampleRate com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.getSampleRate()

获取推流音频采样率。

返回值

推流音频采样率。详情请参见 VeLiveAudioSampleRate。

setSampleRate

public VeLiveAudioEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.setSampleRate(VeLiveAudioSampleRate sampleRate)

设置推流音频采样率。

传入参数

参数名类型说明
sampleRateVeLiveAudioSampleRate推流音频采样率,默认值为 VeLiveAudioSampleRate44100,详情请参见 VeLiveAudioSampleRate。

返回值

推流音频编码参数配置对象,详情请参见 VeLiveAudioEncoderConfiguration。

getChannel

public VeLiveAudioChannel com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.getChannel()

获取推流音频声道。

返回值

推流音频声道。详情请参见 VeLiveAudioChannel。

setChannel

public VeLiveAudioEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.setChannel(VeLiveAudioChannel channel)

设置推流音频声道。

传入参数

参数名类型说明
channelVeLiveAudioChannel推流音频声道,默认值为 VeLiveAudioChannelStereo,详情请参见 VeLiveAudioChannel。

返回值

推流音频编码参数配置对象,详情请参见 VeLiveAudioEncoderConfiguration。

getProfile

public VeLiveAudioProfile com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.getProfile()

获取推流音频编码类型。

返回值

推流音频编码类型。详情请参见 VeLiveAudioProfile。

setProfile

public VeLiveAudioEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.setProfile(VeLiveAudioProfile profile)

设置推流音频编码类型。

传入参数

参数名类型说明
profileVeLiveAudioProfile推流音频编码类型,默认值为 VeLiveAudioAACProfileLC,详情请参见 VeLiveAudioProfile。

返回值

推流音频编码参数配置对象,详情请参见 VeLiveAudioEncoderConfiguration。

VeLiveAudioMixType
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioMixType

音频混流类型。

枚举值

类型值说明
VeLiveAudioMixPush0拉流端可以听到混音效果,本地无法听到。
VeLiveAudioMixPlayAndPush1拉流端和本地都可以听到混音效果。

VeLiveAudioCaptureType
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureType

音频采集类型。

枚举值

类型值说明
VeLiveAudioCaptureMicrophone0使用默认麦克风设备进行音频采集。
VeLiveAudioCaptureVoiceCommunication1使用语音通话模式进行音频采集,此模式下会启动硬件的 3A 功能,即自动增益控制、自动频率控制和自动噪声抑制。
VeLiveAudioCaptureExternal2使用外部设备或源进行音频采集。
VeLiveAudioCaptureMuteFrame3使用静音帧作为音频源。
最近更新时间:2026.01.06 19:52:23
这个页面对您有帮助吗?
有用
有用
无用
无用