public static class com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration
推流视频编码参数。
| 返回 | 名称 |
|---|---|
| VeLiveVideoResolution | getResolution |
| VeLiveVideoEncoderConfiguration | setResolution |
| VeLiveVideoCodec | getCodec |
| VeLiveVideoEncoderConfiguration | setCodec |
| int | getBitrate |
| VeLiveVideoEncoderConfiguration | setBitrate |
| int | getMinBitrate |
| VeLiveVideoEncoderConfiguration | setMinBitrate |
| int | getMaxBitrate |
| VeLiveVideoEncoderConfiguration | setMaxBitrate |
| int | getGopSize |
| VeLiveVideoEncoderConfiguration | setGopSize |
| int | getFps |
| VeLiveVideoEncoderConfiguration | setFps |
| boolean | isEnableBFrame |
| VeLiveVideoEncoderConfiguration | setEnableBFrame |
| boolean | isEnableAccelerate |
| VeLiveVideoEncoderConfiguration | setEnableAccelerate |
public VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getResolution()
获取推流视频分辨率。
返回值
推流视频分辨率 VeLiveVideoResolution。
public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setResolution(VeLiveVideoResolution resolution)
设置推流视频分辨率。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| resolution | VeLiveVideoResolution | 推流视频分辨率,默认值为 VeLiveVideoResolution720P,详情请参见 VeLiveVideoResolution。 |
返回值
推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。
public VeLiveVideoCodec com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getCodec()
获取推流视频编码格式。
返回值
推流视频编码格式,详情请参见 VeLiveVideoCodec。
public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setCodec(VeLiveVideoCodec codec)
设置推流视频编码格式。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| codec | VeLiveVideoCodec | 推流视频编码格式,详情请参见 VeLiveVideoCodec 。 |
返回值
推流视频编码参数,详见 VeLiveVideoEncoderConfiguration。
public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getBitrate()
获取推流视频编码码率。
返回值
推流视频编码码率。
public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setBitrate(int bitrate)
设置推流视频编码码率。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| bitrate | int | 推流视频编码码率,单位为 kbps,默认值由 resolution 参数值决定。 |
返回值
推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。
public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getMinBitrate()
获取推流视频编码最小码率。
返回值
推流视频编码最小码率。
public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setMinBitrate(int minBitrate)
设置推流视频编码最小码率。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| minBitrate | int | 推流视频编码最小码率,单位为 kbps,默认值由 resolution 参数值决定;如果开启自适应码率,推流 SDK 根据网络情况进行编码码率自适应调整的最小码率 |
返回值
推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。
public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getMaxBitrate()
获取推流视频编码最大码率。
返回值
推流视频编码最大码率。
public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setMaxBitrate(int maxBitrate)
设置推流视频编码最大码率。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| maxBitrate | int | 推流视频编码最大码率,单位为 kbps,默认值由 resolution 参数值决定;如果开启自适应码率,推流 SDK 根据网络情况进行编码码率自适应调整的最大码率。 |
返回值
推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。
public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getGopSize()
获取推流视频编码 GOP。
返回值
推流视频编码 GOP。
public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setGopSize(int gopSize)
设置推流视频编码 GOP。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| gopSize | int | 视频 GOP 大小,单位为 s,默认值为 2 |
返回值
推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。
public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.getFps()
获取推流视频编码帧率。
返回值
推流视频编码帧率。
public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setFps(int fps)
设置推流视频编码帧率。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| fps | int | 视频编码帧率,单位为 fps,默认值为 15 |
返回值
推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。
public boolean com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.isEnableBFrame()
获取是否开启 B 帧。
返回值
是否开启B帧。
public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setEnableBFrame(boolean enableBFrame)
设置推流视频编码开启 B 帧。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| enableBFrame | boolean | 是否开启 B 帧。默认为 false。
|
返回值
推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。
public boolean com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.isEnableAccelerate()
获取是否开启硬件编码。
返回值
是否开启硬件编码。
public VeLiveVideoEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEncoderConfiguration.setEnableAccelerate(boolean enableAccelerate)
设置推流视频编码开启硬件编码。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| enableAccelerate | boolean | 是否开启硬件编码。默认值为 true。
|
返回值
推流视频编码参数配置对象,详情请参见 VeLiveVideoEncoderConfiguration。
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCodec
音频编码格式。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveAudioCodecFdkAAC | 0 | FDKAAC 编码。 |
| VeLiveAudioCodecMediaCodecAAC | 1 | Mediacodec AAC 编码。 |
| VeLiveAudioCodecFFmpegAAC | 2 | FFMPEG AAC 编码。 |
public class com.ss.avframework.live.VeLiveVideoFrame
视频帧的数据信息。
| 返回 | 名称 |
|---|---|
| VeLiveVideoFrame | VeLiveVideoFrame |
| VeLiveVideoFrame | VeLiveVideoFrame |
| VeLiveVideoFrame | VeLiveVideoFrame |
| VeLiveVideoFrame | VeLiveVideoFrame |
| void | retain |
| synchronized void | release |
| VeLiveVideoBufferType | getBufferType |
| VeLiveVideoFrame | setBufferType |
| VeLivePixelFormat | getPixelFormat |
| VeLiveVideoFrame | setPixelFormat |
| VeLiveVideoRotation | getRotation |
| VeLiveVideoFrame | setRotation |
| int | getWidth |
| int | getHeight |
| int | getRotatedWidth |
| int | getRotatedHeight |
| long | getPts |
| int | getTextureId |
| void | setTextureId |
| Matrix | getTextureMatrix |
| VeLiveVideoFrame | setTextureMatrix |
| ByteBuffer | getBuffer |
| byte[] | getData |
| Runnable | getReleaseCallback |
| VeLiveVideoFrame | setReleaseCallback |
public com.ss.avframework.live.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 纹理以及纹理矩阵的详细信息。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| width | int | 视频帧的宽度,单位为 px。 |
| height | int | 视频帧的高度,单位为 px。 |
| pts | long | 视频帧的时间戳,单位为 µs。 |
| texId | int | 纹理 ID。 |
| isOes | boolean | 是否是 OES 纹理。 |
| matrix | Matrix | 纹理矩阵。 |
public com.ss.avframework.live.VeLiveVideoFrame.VeLiveVideoFrame( int width, int height, long pts, ByteBuffer byteBuffer )
基于 ByteBuffer 的视频帧初始化方法,适用于视频数据以 ByteBuffer 格式存储的场景,通常用于高效内存处理和直接操作字节流的应用。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| width | int | 视频帧的宽度,单位为 px。 |
| height | int | 视频帧的高度,单位为 px。 |
| pts | long | 视频帧的时间戳,单位为 µs。 |
| byteBuffer | ByteBuffer | ByteBuffer 格式的视频数据,ByteBuffer 默认为 I420 格式,如果您的视频数据为其他格式,可通过调用 setPixelFormat 方法设置。 |
注意
调用该方法时,需要保证 YUV 数据的 stride 等于 width。
public com.ss.avframework.live.VeLiveVideoFrame.VeLiveVideoFrame( int width, int height, long pts, byte[] data )
基于 byte[] 数组的视频帧初始化方法,适用于视频数据以 byte[] 数组格式存储的场景,通常用于直接使用字节数组处理视频帧。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| width | int | 视频帧的宽度,单位为 px。 |
| height | int | 视频帧的高度,单位为 px。 |
| pts | long | 视频帧的时间戳,单位为 µs。 |
| data | byte[] | byte[] 格式的视频数据,默认为 I420 格式,如果您的视频数据为其他格式,可通过调用 setPixelFormat 方法设置。 |
注意
调用该方法时,需要保证 YUV 数据的 stride 等于 width。
public void com.ss.avframework.live.VeLiveVideoFrame.retain()
增加 VeLiveVideoFrame 对象的引用计数。当您需要继续使用 VeLiveVideoFrame 对象时,请调用此方法将引用计数增加 1。
public synchronized void com.ss.avframework.live.VeLiveVideoFrame.release()
释放对 VeLiveVideoFrame 对象的引用。在您不再需要使用 VeLiveVideoFrame 对象时,应调用此方法将引用计数减少 1。当引用计数减少到零,表示不再有引用指向该对象,可以安全地释放或销毁该对象。
public VeLiveVideoBufferType com.ss.avframework.live.VeLiveVideoFrame.getBufferType()
获取视频数据类型。
返回值
视频数据类型,详情请参见 VeLiveVideoBufferType。
public VeLiveVideoFrame com.ss.avframework.live.VeLiveVideoFrame.setBufferType(VeLiveVideoBufferType bufferType)
设置视频数据类型。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| bufferType | VeLiveVideoBufferType | 视频数据类型,详情请参见 VeLiveVideoBufferType。 |
返回值
视频帧对象,详情请参见 VeLiveVideoFrame。
public VeLivePixelFormat com.ss.avframework.live.VeLiveVideoFrame.getPixelFormat()
获取视频像素格式。
返回值
视频像素格式,详情请参见 VeLivePixelFormat。
public VeLiveVideoFrame com.ss.avframework.live.VeLiveVideoFrame.setPixelFormat(VeLivePixelFormat pixelFormat)
设置视频像素格式。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| pixelFormat | VeLivePixelFormat | 视频像素格式,详情请参见 VeLivePixelFormat。 |
返回值
视频帧对象,详情请参见 VeLiveVideoFrame。
public VeLiveVideoRotation com.ss.avframework.live.VeLiveVideoFrame.getRotation()
获取视频帧旋转角度。
返回值
视频帧旋转角度,详情请参见 VeLiveVideoRotation。
public VeLiveVideoFrame com.ss.avframework.live.VeLiveVideoFrame.setRotation(VeLiveVideoRotation rotation)
设置视频帧旋转角度。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| rotation | VeLiveVideoRotation | 视频帧旋转角度,详情请参见 VeLiveVideoRotation。 |
返回值
视频帧对象,详情请参见 VeLiveVideoFrame。
public int com.ss.avframework.live.VeLiveVideoFrame.getWidth()
获取视频帧宽度。
返回值
视频帧宽度。
public int com.ss.avframework.live.VeLiveVideoFrame.getHeight()
获取视频帧高度。
返回值
视频帧高度。
public int com.ss.avframework.live.VeLiveVideoFrame.getRotatedWidth()
获取带旋转角度的视频帧宽度。
返回值
带旋转角度的视频帧宽度。
public int com.ss.avframework.live.VeLiveVideoFrame.getRotatedHeight()
获取带旋转角度的视频帧高度。
返回值
带旋转角度的视频帧高度。
public long com.ss.avframework.live.VeLiveVideoFrame.getPts()
获取视频帧时间戳。
返回值
视频帧时间戳,单位为 μs。
public int com.ss.avframework.live.VeLiveVideoFrame.getTextureId()
获取视频帧纹理 ID。
返回值
视频帧纹理 ID。
public void com.ss.avframework.live.VeLiveVideoFrame.setTextureId(int textureId)
设置当前视频帧的纹理 ID,用于在图像渲染过程中标识 GPU 中的纹理资源。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| textureId | int | 纹理 ID,用于标识当前帧绑定的纹理资源。 |
public Matrix com.ss.avframework.live.VeLiveVideoFrame.getTextureMatrix()
获取当前视频帧的纹理变换矩阵。该矩阵用于对纹理坐标进行变换,例如旋转、缩放或翻转操作。
返回值
一个 Matrix 对象,表示当前帧的纹理变换矩阵。
public VeLiveVideoFrame com.ss.avframework.live.VeLiveVideoFrame.setTextureMatrix(Matrix matrix)
设置当前视频帧的纹理变换矩阵。用于在渲染前对图像纹理进行几何变换。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| matrix | Matrix | 纹理变换矩阵。 |
返回值
VeLiveVideoFrame 实例,支持链式调用。
public ByteBuffer com.ss.avframework.live.VeLiveVideoFrame.getBuffer()
获取 ByteBuffer 格式的视频数据。
返回值
ByteBuffer 格式的视频数据。
public byte[] com.ss.avframework.live.VeLiveVideoFrame.getData()
获取 byte[] 格式的视频数据。
返回值
byte[] 格式的视频数据。
public Runnable com.ss.avframework.live.VeLiveVideoFrame.getReleaseCallback()
获取视频帧内部销毁回调。
返回值
视频帧内部销毁回调。
public VeLiveVideoFrame com.ss.avframework.live.VeLiveVideoFrame.setReleaseCallback(Runnable releaseCallback)
设置视频帧内部销毁回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| releaseCallback | Runnable | 视频帧内部销毁回调 |
返回值
视频帧对象,详情请参见 VeLiveVideoFrame。
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCodec
视频编码格式。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveVideoCodecH264 | h264 | 使用 H.264 视频编码。 |
| VeLiveVideoCodecByteVC1 | bytevc1 | 使用火山引擎自研 ByteVC1 视频编码。 |
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 |
public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.encodeWidth
视频编码宽度,单位为 px。
public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.encodeHeight
视频编码高度,单位为 px。
public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.captureWidth
视频采集宽度,单位为 px。
public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.captureHeight
视频采集高度,单位为 px。
public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.captureFps
视频采集帧率,单位为 fps。
public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.encodeFps
视频编码帧率,单位为 fps。
public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.transportFps
视频发送帧率,可用展示实时帧率,单位为 fps。
public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.fps
视频推流帧率,即您通过 setVideoEncoderConfiguration 方法设置的帧率,单位为 fps。
public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.videoBitrate
视频推流码率,即您通过 setVideoEncoderConfiguration 方法设置的码率,单位为 kbps。
public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.minVideoBitrate
视频推流最小码率,即您通过 setVideoEncoderConfiguration 方法设置的最小码率,单位为 kbps。
public int com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.maxVideoBitrate
视频推流最大码率,即您通过 setVideoEncoderConfiguration 方法设置的最大码率,单位为 kbps。
public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.encodeVideoBitrate
视频编码码率,单位为 kbps。
public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.transportVideoBitrate
视频发送码率,可用于展示实时码率,单位为 kbps。
public double com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.encodeAudioBitrate
音频编码码率,单位为 kbps。
public String com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.url
推流地址。
public String com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatistics.codec
视频编码格式。
public enum com.ss.avframework.live.VeLivePusherDef.VeLivePusherRenderMode
推流渲染模式。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLivePusherRenderModeFill | 0 | 视频帧自适应画布。视频帧非等比缩放,直至画布被填满。在此过程中,视频帧的长宽比例可能会发生变化。 |
| VeLivePusherRenderModeFit | 1 | 视频帧内容全部显示优先。视频尺寸等比缩放,优先保证视频内容全部显示。当视频尺寸与显示窗口尺寸不一致时,会把窗口未被填满的区域填充成背景颜色。 |
| VeLivePusherRenderModeHidden | 2 | 视窗填满优先。视频帧等比缩放,直至视窗被视频填满。如果视频帧长宽比例与视窗不同,视频帧的多出部分将无法显示。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseType
视频特效的许可证认证方式。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveVideoEffectLicenseTypeOffLine | 0 | 离线认证视频特效许可证。 |
| VeLiveVideoEffectLicenseTypeOnLine | 1 | 在线认证视频特效许可证。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioBufferType
推流音频数据类型。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveAudioBufferTypeUnknown | 0 | 未知的音频数据类型。 |
| VeLiveAudioBufferTypeByteBuffer | 1 | ByteBuffer 音频数据类型。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioChannel
推流音频声道数,决定音频的立体感。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveAudioChannelMono | 1 | 单声道,适用于语音通信,节省带宽。 |
| VeLiveAudioChannelStereo | 2 | 立体声,适用于音乐播放,提供更丰富的音频体验。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveFirstFrameType
定义了推流中首帧的类型,包括音视频的采集首帧、渲染首帧、编码完成首帧和发送首帧。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveFirstCaptureFrame | 0 | 视频/音频采集首帧,采集首帧是从音频设备或视频设备(如麦克风、摄像头)获取的第一帧数据。 |
| VeLiveFirstRenderFrame | 1 | 视频渲染首帧,渲染首帧是在渲染过程中在屏幕上显示的第一帧视频数据。 |
| VeLiveFirstEncodedFrame | 2 | 视频/音频编码完成首帧,编码完成首帧是编码为某种特定格式的第一帧数据。 |
| VeLiveFirstSendFrame | 3 | 视频/音频发送首帧,发送首帧是在发送过程中,通过网络传输的第一帧数据。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureType
视频采集类型。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveVideoCaptureFrontCamera | 0 | 使用前置摄像头进行视频采集。 |
| VeLiveVideoCaptureBackCamera | 1 | 使用后置摄像头进行视频采集。 |
| VeLiveVideoCaptureScreen | 2 | 使用屏幕采集。 |
| VeLiveVideoCaptureExternal | 3 | 使用外部设备或源进行视频采集。 |
| VeLiveVideoCaptureCustomImage | 4 | 使用指定的静态图片作为视频源。 |
| VeLiveVideoCaptureLastFrame | 5 | 使用最近采集的一帧图像重复作为视频源。 |
| VeLiveVideoCaptureDummyFrame | 6 | 使用黑色帧作为视频源,一般用于调试或特殊需求。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoProfile
相机视频配置枚举类。用于设置相机的视频配置参数,包括视频编码格式和参数等。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveVideoProfileUnknown | 0 | 未知的视频配置类型。 |
| VeLiveVideoProfileH264Baseline | 1 | H.264 编码配置,使用 Baseline 级别。 |
| VeLiveVideoProfileH264Main | 2 | H.264 编码配置,使用 Main 级别。 |
| VeLiveVideoProfileH264High | 3 | H.264 编码配置,使用 High 级别。 |
| VeLiveVideoProfileByteVC1Main | 4 | ByteVC1 编码配置,使用 Main 级别。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoRotation
视频帧旋转角度。以 App 方向为旋转参考系。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveVideoRotation0 | 0 | 不旋转。 |
| VeLiveVideoRotation90 | 90 | 顺时针旋转 90 度。 |
| VeLiveVideoRotation180 | 180 | 顺时针旋转 180 度。 |
| VeLiveVideoRotation270 | 270 | 顺时针旋转 270 度。 |
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameSource
视频帧来源。
| 类型 | 默认值 | 名称 |
|---|---|---|
| int | 1 | VeLiveVideoFrameSourceCapture |
| int | 1 << 1 | VeLiveVideoFrameSourcePreEncode |
| 返回 | 名称 |
|---|---|
| VeLiveVideoFrameSource | VeLiveVideoFrameSource |
public static final int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameSource.VeLiveVideoFrameSourceCapture = 1
采集到的原始视频帧。这是从设备的摄像头或其他视频输入源获取的视频帧。
public static final int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameSource.VeLiveVideoFrameSourcePreEncode = 1 << 1
编码前的视频帧。这是通过各种处理(例如滤镜、旋转等)后,准备进行编码的视频帧。
public com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameSource.VeLiveVideoFrameSource(int source)
创建一个视频帧源对象。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| source | int | 视频帧源标识。当取值为 VeLiveVideoFrameSourceCapture | VeLiveVideoFrameSourcePreEncode 时,表示同时订阅 VeLiveVideoFrameSourceCapture 和 VeLiveVideoFrameSourcePreEncode 2 种类型。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioProfile
AAC 音频编码档位。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveAudioAACProfileLC | 0 | LC-AAC 编码方式。 |
| VeLiveAudioAACProfileHEv1 | 1 | HEv1-AAC 编码方式。 |
| VeLiveAudioAACProfileHEv2 | 2 | HEv2-AAC 编码方式。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoBufferType
推流视频数据类型。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveVideoBufferTypeUnknown | 0 | 未知视频数据类型,当未指定输入视频数据的格式时,会默认为此类型。 |
| VeLiveVideoBufferTypeTexture | 1 | 视频数据类型为 OpenGL 纹理。 |
| VeLiveVideoBufferTypeByteBuffer | 2 | 视频数据类型为 ByteBuffer 类型。 |
| VeLiveVideoBufferTypeByteArray | 3 | 视频数据类型为 ByteArray 类型。 |
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureConfiguration
音频采集配置。
| 返回 | 名称 |
|---|---|
| VeLiveAudioSampleRate | getSampleRate |
| VeLiveAudioCaptureConfiguration | setSampleRate |
| VeLiveAudioChannel | getChannel |
| VeLiveAudioCaptureConfiguration | setChannel |
public VeLiveAudioSampleRate com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureConfiguration.getSampleRate()
获取采集音频采样率。
返回值
音频采样率,详情请参见 VeLiveAudioSampleRate。
public VeLiveAudioCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureConfiguration.setSampleRate(VeLiveAudioSampleRate sampleRate)
设置采集音频采样率。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| sampleRate | VeLiveAudioSampleRate | 音频采样率,默认值为 VeLiveAudioSampleRate44100,详情请参见 VeLiveAudioSampleRate。 |
返回值
推流音频采集参数配置对象,详情请参见 VeLiveAudioCaptureConfiguration。
public VeLiveAudioChannel com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureConfiguration.getChannel()
获取采集音频声道数。
返回值
音频声道数,详情请参见 VeLiveAudioChannel。
public VeLiveAudioCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureConfiguration.setChannel(VeLiveAudioChannel channel)
设置采集音频声道数。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| channel | VeLiveAudioChannel | 音频声道数,默认值为 VeLiveAudioChannelStereo,详情请参见 VeLiveAudioChannel |
返回值
推流音频采集参数配置对象,详情请参见 VeLiveAudioCaptureConfiguration。
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveStreamMixDescription
音视频混流布局。包含了视频混流布局、音频混流布局和画布背景色等属性。
| 类型 | 默认值 | 名称 |
|---|---|---|
| ArrayList<VeLiveMixVideoLayout> | new ArrayList<>() | mixVideoStreams |
| ArrayList<VeLiveMixAudioLayout> | new ArrayList<>() | mixAudioStreams |
| String | "#000000" | backgroundColor |
public final ArrayList<VeLiveMixVideoLayout> com.ss.avframework.live.VeLivePusherDef.VeLiveStreamMixDescription.mixVideoStreams = new ArrayList<>()
视频混流布局设置的数组,其中每个元素代表一路视频流的布局。详情请参见 VeLiveMixVideoLayout。
public final ArrayList<VeLiveMixAudioLayout> com.ss.avframework.live.VeLivePusherDef.VeLiveStreamMixDescription.mixAudioStreams = new ArrayList<>()
音频混流设置的数组,其中每个元素代表一路音频流的。详情请参见 VeLiveMixAudioLayout。
public String com.ss.avframework.live.VeLivePusherDef.VeLiveStreamMixDescription.backgroundColor = "#000000"
视频混流画布的背景色设置,采用 #RRGGBB 格式。
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioSampleRate
推流音频采样率。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveAudioSampleRate8000 | 8000 | 8k 采样。 |
| VeLiveAudioSampleRate16000 | 16000 | 16k 采样。 |
| VeLiveAudioSampleRate32000 | 32000 | 32k 采样。 |
| VeLiveAudioSampleRate44100 | 44100 | 44.1k 采样。 |
| VeLiveAudioSampleRate48000 | 48000 | 48k 采样。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioPowerLevel
音量等级,用于评估和控制音频的响度。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveAudioPowerLevelSilent | 0 | 无声,音量 ≤1db。 |
| VeLiveAudioPowerLevelQuiet | 1 | 安静,音量 15db 以下。 |
| VeLiveAudioPowerLevelLight | 2 | 轻声,接近耳语音量,音量为 16db~30db 之间。 |
| VeLiveAudioPowerLevelNormal | 3 | 正常,音量适宜,类似正常对话的音量,音量为 30db~60db 之间。 |
| VeLiveAudioPowerLevelLoud | 4 | 较大,音量较高,类似咖啡馆、餐厅的环境噪音,音量为 61db~85db 之间。 |
| VeLiveAudioPowerLevelNoise | 5 | 吵闹,音量极高,类似于繁忙的街道或者是音乐会现场,音量超过 85db。 |
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration
视频采集配置。
| 返回 | 名称 |
|---|---|
| int | getWidth |
| VeLiveVideoCaptureConfiguration | setWidth |
| int | getHeight |
| VeLiveVideoCaptureConfiguration | setHeight |
| int | getFps |
| VeLiveVideoCaptureConfiguration | setFps |
| VeLiveVideoCaptureConfiguration | setDefaultFrontCameraMirrored |
| boolean | isDefaultFrontCameraMirrored |
public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.getWidth()
获取采集视频宽度。
返回值
采集视频宽度。
public VeLiveVideoCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.setWidth(int width)
设置采集视频宽度。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| width | int | 采集视频宽度,默认值为 720。 |
返回值
推流视频采集参数配置对象,详情请参见 VeLiveVideoCaptureConfiguration。
public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.getHeight()
获取采集视频高度。
返回值
采集视频高度。
public VeLiveVideoCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.setHeight(int height)
设置采集视频高度。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| height | int | 采集视频高度,默认值为 1280。 |
返回值
推流视频采集参数配置对象,详情请参见 VeLiveVideoCaptureConfiguration。
public int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.getFps()
获取采集视频帧率。
返回值
采集视频帧率。
public VeLiveVideoCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.setFps(int fps)
设置采集视频帧率。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| fps | int | 采集视频帧率,默认值为 15。 |
返回值
推流视频采集参数配置对象,详情请参见 VeLiveVideoCaptureConfiguration。
public VeLiveVideoCaptureConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.setDefaultFrontCameraMirrored(boolean mirror)
设置前置摄像头采集时,是否默认为镜像状态。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| mirror | boolean | 前置摄像头采集时,是否默认为镜像状态。默认值为 true。取值如下:
|
返回值
视频采集配置。详情请参见 VeLiveVideoCaptureConfiguration。
public boolean com.ss.avframework.live.VeLivePusherDef.VeLiveVideoCaptureConfiguration.isDefaultFrontCameraMirrored()
获取前置摄像头采集时的默认镜像状态。适用于需要确认前置摄像头默认镜像状态的场景,例如主播在直播前确认初始预览画面是否符合预期。
返回值
前置摄像头采集时的默认镜像状态。
true:镜像状态。false:非镜像状态。public enum com.ss.avframework.live.VeLivePusherDef.VeLivePixelFormat
视频帧的数据格式。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLivePixelFormatUnknown | 0 | 未知格式。 |
| VeLivePixelFormatI420 | 1 | I420 格式。 |
| VeLivePixelFormatNV12 | 2 | NV12 格式。 |
| VeLivePixelFormatNV21 | 3 | NV21 格式。 |
| VeLivePixelFormat2DTexture | 4 | 2D 纹理格式。 |
| VeLivePixelFormatOesTexture | 5 | OES 纹理格式。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatus
推流器与服务器的连接状态。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLivePushStatusNone | 0 | 初始状态。 |
| VeLivePushStatusConnecting | 1 | 正在连接服务器。 |
| VeLivePushStatusConnectSuccess | 2 | 连接服务器成功。 |
| VeLivePushStatusReconnecting | 3 | 重连服务器中。 |
| VeLivePushStatusConnectStop | 4 | 推流连接被终止。 |
| VeLivePushStatusConnectError | 5 | 推流连接失败。 |
| VeLivePushStatusDisconnected | 6 | 与服务器断开连接。 |
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution
推流视频分辨率档位枚举值。
| 类型 | 默认值 | 名称 |
|---|---|---|
| VeLiveVideoResolution | newVeLiveVideoResolution(360, 640, 15, 500, 250, 800) | VeLiveVideoResolution360P |
| VeLiveVideoResolution | newVeLiveVideoResolution(480, 864, 15, 800, 320, 1266) | VeLiveVideoResolution480P |
| VeLiveVideoResolution | newVeLiveVideoResolution(540, 960, 15, 1000, 500, 1520) | VeLiveVideoResolution540P |
| VeLiveVideoResolution | newVeLiveVideoResolution(720, 1280, 15, 1200, 800, 1900) | VeLiveVideoResolution720P |
| VeLiveVideoResolution | newVeLiveVideoResolution(1080, 1920, 20, 2500, 1000, 3800) | VeLiveVideoResolution1080P |
public static final VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution.VeLiveVideoResolution360P = newVeLiveVideoResolution(360, 640, 15, 500, 250, 800)
360P 分辨率。档位详细配置如下所示。
public static final VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution.VeLiveVideoResolution480P = newVeLiveVideoResolution(480, 864, 15, 800, 320, 1266)
480P 分辨率。档位详细配置如下所示。
public static final VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution.VeLiveVideoResolution540P = newVeLiveVideoResolution(540, 960, 15, 1000, 500, 1520)
540P 分辨率。档位详细配置如下所示。
public static final VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution.VeLiveVideoResolution720P = newVeLiveVideoResolution(720, 1280, 15, 1200, 800, 1900)
720P 分辨率。档位详细配置如下所示。
public static final VeLiveVideoResolution com.ss.avframework.live.VeLivePusherDef.VeLiveVideoResolution.VeLiveVideoResolution1080P = newVeLiveVideoResolution(1080, 1920, 20, 2500, 1000, 3800)
1080P 分辨率。档位详细配置如下所示。
public class com.ss.avframework.live.VeLiveAudioFrame
音频帧的数据信息。
| 返回 | 名称 |
|---|---|
| VeLiveAudioFrame | VeLiveAudioFrame |
| VeLiveAudioBufferType | getBufferType |
| VeLiveAudioSampleRate | getSampleRate |
| VeLiveAudioChannel | getChannels |
| int | getSamplesPerChannel |
| long | getPts |
| ByteBuffer | getBuffer |
public com.ss.avframework.live.VeLiveAudioFrame.VeLiveAudioFrame( VeLiveAudioSampleRate sampleRate, VeLiveAudioChannel channel, long pts, ByteBuffer buffer )
音频帧初始化方法。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| sampleRate | VeLiveAudioSampleRate | 音频采样率。详情请参见 VeLiveAudioSampleRate。 |
| channel | VeLiveAudioChannel | 音频声道数。详情请参见 VeLiveAudioChannel。 |
| pts | long | 音频时间戳,单位为 μs。 |
| buffer | ByteBuffer | ByteBuffer 格式的音频数据。 |
public VeLiveAudioBufferType com.ss.avframework.live.VeLiveAudioFrame.getBufferType()
获取音频数据类型。
返回值
音频数据类型,详情请参见 VeLiveAudioBufferType。
public VeLiveAudioSampleRate com.ss.avframework.live.VeLiveAudioFrame.getSampleRate()
获取音频采样率。
返回值
音频采样率,详情请参见 VeLiveAudioSampleRate。
public VeLiveAudioChannel com.ss.avframework.live.VeLiveAudioFrame.getChannels()
获取音频声道数。
返回值
音频声道数,详情请参见 VeLiveAudioChannel。
public int com.ss.avframework.live.VeLiveAudioFrame.getSamplesPerChannel()
获取每个声道的采样点数。
返回值
采样点数。
public long com.ss.avframework.live.VeLiveAudioFrame.getPts()
获取音频时间戳,单位为 μs。
返回值
音频时间戳,单位为 μs。
public ByteBuffer com.ss.avframework.live.VeLiveAudioFrame.getBuffer()
获取音频数据。音频帧数据为小端字节序存储。
返回值
格式为 ByteBuffer 的音频数据。
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveNetworkQuality
网络质量/状态。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveNetworkQualityUnknown | 0 | 未查询到网络状态。 |
| VeLiveNetworkQualityBad | 1 | 网络差。 |
| VeLiveNetworkQualityPoor | 2 | 网络一般。 |
| VeLiveNetworkQualityGood | 3 | 网络状态佳。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLivePusherLogLevel
输出的日志级别。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveLogLevelVerbose | AVLog.VERBOSE | 输出 VERBOSE、DEBUG、INFO、WARNING 和 ERROR 级别的日志。 |
| VeLiveLogLevelDebug | AVLog.DEBUG | 输出 DEBUG、INFO、WARNING 和 ERROR 级别的日志。 |
| VeLiveLogLevelInfo | AVLog.INFO | 输出 INFO、WARNING 和 ERROR 级别的日志。 |
| VeLiveLogLevelWarn | AVLog.WARN | 输出 WARNING 和 ERROR 级别的日志。 |
| VeLiveLogLevelError | AVLog.ERROR | 输出 ERROR 级别的日志。 |
| VeLiveLogLevelNone | AVLog.NONE | 关闭日志。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioBitDepth
推流音频位深度。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveAudioBitDepth16 | 16 | 16bit 位深度。 |
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveMixAudioLayout
音频混流设置。
| 类型 | 默认值 | 名称 |
|---|---|---|
| int | -1 | streamId |
| float | 1.0f | volume |
| 返回 | 名称 |
|---|---|
| void | update |
public int com.ss.avframework.live.VeLivePusherDef.VeLiveMixAudioLayout.streamId = -1
音频流 ID,唯一标识,用于区分不同的音频流。
public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixAudioLayout.volume = 1.0f
混流音频的音量,范围为 [0.0,4.0]。当您将 VeLiveAudioMixType 设置为 VeLiveAudioMixPlayAndPush 时,该变量同时控制混流音频在拉流端和本地的播放音量。
public void com.ss.avframework.live.VeLivePusherDef.VeLiveMixAudioLayout.update(VeLiveMixAudioLayout other)
更新音频混流设置。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| other | VeLiveMixAudioLayout | 新的音频混流设置,详情请参见 VeLiveMixAudioLayout。 |
public class com.ss.avframework.live.VeLivePusherConfiguration
推流引擎初始化配置。
| 返回 | 名称 |
|---|---|
| VeLivePusherConfiguration | setReconnectIntervalSeconds |
| int | getReconnectIntervalSeconds |
| VeLivePusherConfiguration | setReconnectCount |
| int | getReconnectCount |
| VeLivePusherConfiguration | setVideoCaptureConfig |
| VeLiveVideoCaptureConfiguration | getVideoCaptureConfig |
| VeLivePusherConfiguration | setAudioCaptureConfig |
| VeLiveAudioCaptureConfiguration | getAudioCaptureConfig |
| VeLivePusherConfiguration | setContext |
| Context | getContext |
| VeLivePusherConfiguration | setExtraParameters |
| LiveSdkSetting | getExtraParams |
| VeLivePusher | build |
public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setReconnectIntervalSeconds(int interval)
设置推流器推流失败后尝试重连的时间间隔。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| interval | int | 时间间隔,单位为 s,默认值为 5 |
public int com.ss.avframework.live.VeLivePusherConfiguration.getReconnectIntervalSeconds()
获取推流器推流失败后尝试重连的时间间隔。
返回值
时间间隔,单位为 s。
public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setReconnectCount(int maxCount)
设置推流器推流失败后尝试重连的次数。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| maxCount | int | 重连次数,默认值为 3 |
public int com.ss.avframework.live.VeLivePusherConfiguration.getReconnectCount()
获取推流器推流失败后尝试重连的次数。
返回值
重连次数。
public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setVideoCaptureConfig(VeLiveVideoCaptureConfiguration config)
设置视频采集参数,用于调整和设置视频采集相关的参数。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| config | VeLiveVideoCaptureConfiguration | 视频采集参数,详情请参见 VeLiveVideoCaptureConfiguration。 |
返回值
推流引擎初始化配置对象,详情请参见 VeLivePusherConfiguration。
public VeLiveVideoCaptureConfiguration com.ss.avframework.live.VeLivePusherConfiguration.getVideoCaptureConfig()
获取视频采集参数,用于调整和设置视频采集相关的参数。
返回值
视频采集参数配置对象,详情请参见 VeLiveVideoCaptureConfiguration。
public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setAudioCaptureConfig(VeLiveAudioCaptureConfiguration config)
设置音频采集参数,用于调整和设置音频采集相关的参数。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| config | VeLiveAudioCaptureConfiguration | 音频采集参数,详情请参见 VeLiveAudioCaptureConfiguration。 |
返回值
推流引擎初始化配置对象,详情请参见 VeLiveAudioCaptureConfiguration。
public VeLiveAudioCaptureConfiguration com.ss.avframework.live.VeLivePusherConfiguration.getAudioCaptureConfig()
获取音频采集参数,用于调整和设置音频采集相关的参数。
返回值
音频采集参数配置对象,详情请参见 VeLiveAudioCaptureConfiguration。
public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setContext(Context context)
设置应用上下文。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| context | Context | 应用上下文。 |
返回值
推流引擎初始化配置对象,详情请参见 VeLivePusherConfiguration。
public Context com.ss.avframework.live.VeLivePusherConfiguration.getContext()
获取应用上下文。
返回值
应用上下文。
public VeLivePusherConfiguration com.ss.avframework.live.VeLivePusherConfiguration.setExtraParameters(String params)
设置扩展参数,默认不需要设置。如果需要使用,您可通过提交工单联系技术支持。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| params | String | 扩展参数。 |
返回值
推流引擎初始化配置对象,详情请参见 VeLivePusherConfiguration。
public LiveSdkSetting com.ss.avframework.live.VeLivePusherConfiguration.getExtraParams()
获取扩展参数。
返回值
扩展参数。
public VeLivePusher com.ss.avframework.live.VeLivePusherConfiguration.build()
构造推流引擎。
返回值
推流引擎,详情请参见 VeLivePusher。
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveOrientation
推流横竖屏模式。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveOrientationLandscape | 0 | 横屏模式。 |
| VeLiveOrientationPortrait | 1 | 竖屏模式。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveVideoMirrorType
视频镜像类型。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveVideoMirrorCapture | 0 | 对采集画面的镜像控制。开启时,预览和推流画面都会呈现为镜像状态。 |
| VeLiveVideoMirrorPreview | 1 | 对预览画面的镜像控制。开启时,只有主播预览画面呈现镜像状态。 |
| VeLiveVideoMirrorPushStream | 2 | 对编码前画面的镜像控制。开启时,主播推流画面呈现镜像状态。 |
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration
推流本地文件录制配置。
| 返回 | 名称 |
|---|---|
| int | getWidth |
| VeLiveFileRecorderConfiguration | setWidth |
| int | getHeight |
| VeLiveFileRecorderConfiguration | setHeight |
| int | getFps |
| VeLiveFileRecorderConfiguration | setFps |
| int | getBitrate |
| VeLiveFileRecorderConfiguration | setBitrate |
public int com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.getWidth()
获取录制视频宽度。
返回值
录制视频宽度。
public VeLiveFileRecorderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.setWidth(int width)
设置录制视频宽度。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| width | int | 录制视频宽度,默认值为 360 |
返回值
推流本地文件录制配置对象,详情请参见 VeLiveFileRecorderConfiguration。
public int com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.getHeight()
获取录制视频高度。
返回值
录制视频高度。
public VeLiveFileRecorderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.setHeight(int height)
设置录制视频高度。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| height | int | 录制视频宽度,默认值为 640。 |
返回值
推流本地文件录制配置对象,详情请参见 VeLiveFileRecorderConfiguration。
public int com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.getFps()
获取录制视频帧率。
返回值
录制视频帧率。
public VeLiveFileRecorderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.setFps(int fps)
设置录制视频帧率。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| fps | int | 录制视频帧率,默认值为 15。 |
返回值
推流本地文件录制配置对象,详情请参见 VeLiveFileRecorderConfiguration。
public int com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.getBitrate()
获取录制视频码率。
返回值
录制视频码率。
public VeLiveFileRecorderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecorderConfiguration.setBitrate(int bitrate)
设置录制视频码率。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| bitrate | int | 录制视频码率,单位为 kbps,默认值为 2000。 |
返回值
推流本地文件录制配置对象,详情请参见 VeLiveFileRecorderConfiguration。
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout
视频混流设置。
| 类型 | 默认值 | 名称 |
|---|---|---|
| int | -1 | streamId |
| float | 0 | x |
| float | 0 | y |
| float | 1 | width |
| float | 1 | height |
| float | 1 | alpha |
| int | 0 | zOrder |
| VeLivePusherRenderMode | VeLivePusherRenderMode.VeLivePusherRenderModeFill | renderMode |
| boolean | true | enableAlpha |
| 返回 | 名称 |
|---|---|
| void | update |
public int com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.streamId = -1
视频流 ID,唯一标识,用于区分不同的视频流。
public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.x = 0
视频流对应区域左上角的横坐标,该坐标是相对整体画面的归一化比例,取值的范围为 [0.0,1.0]。
public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.y = 0
视频流对应区域左上角的纵坐标,该坐标是相对整体画面的归一化比例,取值的范围为 [0.0,1.0]。
public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.width = 1
视频流对应区域宽度,该宽度是相对整体画面的归一化比例,取值的范围为 [0.0,1.0]。
public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.height = 1
视频流对应区域高度,该高度是相对整体画面的归一化比例,取值的范围为 [0.0,1.0]。
public float com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.alpha = 1
视频流在混流中的透明度,取值范围为 [0.0,1.0],取值 0.0 表示全透明,取值 1.0 表示不透明。
public int com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.zOrder = 0
视频流在混流中的层级。取值范围为 [0,100],取值 0 表示最底层,取值越大,层级越高。
public VeLivePusherRenderMode com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.renderMode = VeLivePusherRenderMode.VeLivePusherRenderModeFill
视频流的渲染模式。详情请参见 VeLivePusherRenderMode。
public boolean com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.enableAlpha = true
是否保留视频流原 Alpha 通道值,默认为保留,当 alpha 取值在 [0.0, 1.0] 之间时,则忽略该配置。
public void com.ss.avframework.live.VeLivePusherDef.VeLiveMixVideoLayout.update(VeLiveMixVideoLayout other)
更新视频混流设置。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| other | VeLiveMixVideoLayout | 新的视频混流设置,详情请参见 VeLiveMixVideoLayout。 |
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration
视频特效许可证配置。
| 返回 | 名称 |
|---|---|
| static VeLiveVideoEffectLicenseConfiguration | create |
| static VeLiveVideoEffectLicenseConfiguration | create |
| 返回 | 名称 |
|---|---|
| VeLiveVideoEffectLicenseType | getType |
| String | getPath |
| String | getKey |
| String | getSecret |
| String | getUrl |
public static VeLiveVideoEffectLicenseConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.create(String path)
初始化配置为本地验证模式。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| path | String | 视频特效许可证的本地缓存路径。可通过 getPath 获取。 |
返回值
返回 VeLiveVideoEffectLicenseConfiguration 类的实例,该实例使用指定的本地路径进行许可证验证。
public static VeLiveVideoEffectLicenseConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.create( String key, String secret, String url )
初始化配置为在线验证模式。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| key | String | 视频特效许可证的在线认证 key。可通过 getKey 获取。 |
| secret | String | 视频特效许可证的在线认证 secret。可通过 getSecret 获取。 |
| url | String | 视频特效许可证的在线认证地址,如果传入 null,可通过 getUrl 获取在线认证地址。 |
返回值
返回 VeLiveVideoEffectLicenseConfiguration 类的实例,该实例使用指定的 key、secret 和 url 进行在线许可证验证。
public VeLiveVideoEffectLicenseType com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.getType()
获取视频特效许可证类型。
返回值
视频特效许可证类型,许可证类型请参见 VeLiveVideoEffectLicenseType。
public String com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.getPath()
获取视频特效许可证的本地路径。当 VeLiveVideoEffectLicenseType 为 VeLiveVideoEffectLicenseTypeOffLine 时,返回许可证文件的本地路径。
返回值
视频特效许可证的本地路径。
public String com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.getKey()
获取视频特效许可证的在线认证 key。当 VeLiveVideoEffectLicenseType 为 VeLiveVideoEffectLicenseTypeOnLine 时,返回在线认证的 key。
返回值
视频特效许可证的在线认证 key。
public String com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.getSecret()
获取视频特效许可证的在线认证 secret。当 VeLiveVideoEffectLicenseType 为 VeLiveVideoEffectLicenseTypeOnLine 时,返回在线认证的 secret。
返回值
视频特效许可证的在线认证 secret。
public String com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectLicenseConfiguration.getUrl()
获取视频特效许可证的在线认证地址。当 VeLiveVideoEffectLicenseType 为 VeLiveVideoEffectLicenseTypeOnLine 时,返回在线认证地址。
返回值
视频特效许可证的在线认证地址。
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameSource
音频帧来源。
| 类型 | 默认值 | 名称 |
|---|---|---|
| int | 1 | VeLiveAudioFrameSourceCapture |
| int | 1 << 1 | VeLiveAudioFrameSourcePreEncode |
| 返回 | 名称 |
|---|---|
| VeLiveAudioFrameSource | VeLiveAudioFrameSource |
public static final int com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameSource.VeLiveAudioFrameSourceCapture = 1
采集到的原始音频帧。这是从设备的麦克风或其他音频输入源获取的音频帧。
public static final int com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameSource.VeLiveAudioFrameSourcePreEncode = 1 << 1
编码前的音频帧。这是通过各种处理(例如噪音消除、回声消除等)后,准备进行编码的音频帧。
public com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameSource.VeLiveAudioFrameSource(int source)
创建一个音频帧源对象。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| source | int | 音频帧源标识,当取值为 VeLiveAudioFrameSourceCapture | VeLiveAudioFrameSourcePreEncode 时,表示同时订阅 VeLiveAudioFrameSourceCapture 和 VeLiveAudioFrameSourcePreEncode 2 种类型。 |
public static class com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration
推流音频编码参数。
| 返回 | 名称 |
|---|---|
| int | getBitrate |
| VeLiveAudioEncoderConfiguration | setBitrate |
| VeLiveAudioSampleRate | getSampleRate |
| VeLiveAudioEncoderConfiguration | setSampleRate |
| VeLiveAudioChannel | getChannel |
| VeLiveAudioEncoderConfiguration | setChannel |
| VeLiveAudioProfile | getProfile |
| VeLiveAudioEncoderConfiguration | setProfile |
public int com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.getBitrate()
获取推流音频编码码率。
返回值
推流音频编码码率。
public VeLiveAudioEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.setBitrate(int bitrate)
设置推流音频编码码率。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| bitrate | int | 推流音频编码码率,单位为 kbps,默认值为 64。 |
返回值
public VeLiveAudioSampleRate com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.getSampleRate()
获取推流音频采样率。
返回值
推流音频采样率。详情请参见 VeLiveAudioSampleRate。
public VeLiveAudioEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.setSampleRate(VeLiveAudioSampleRate sampleRate)
设置推流音频采样率。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| sampleRate | VeLiveAudioSampleRate | 推流音频采样率,默认值为 VeLiveAudioSampleRate44100,详情请参见 VeLiveAudioSampleRate。 |
返回值
推流音频编码参数配置对象,详情请参见 VeLiveAudioEncoderConfiguration。
public VeLiveAudioChannel com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.getChannel()
获取推流音频声道。
返回值
推流音频声道。详情请参见 VeLiveAudioChannel。
public VeLiveAudioEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.setChannel(VeLiveAudioChannel channel)
设置推流音频声道。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| channel | VeLiveAudioChannel | 推流音频声道,默认值为 VeLiveAudioChannelStereo,详情请参见 VeLiveAudioChannel。 |
返回值
推流音频编码参数配置对象,详情请参见 VeLiveAudioEncoderConfiguration。
public VeLiveAudioProfile com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.getProfile()
获取推流音频编码类型。
返回值
推流音频编码类型。详情请参见 VeLiveAudioProfile。
public VeLiveAudioEncoderConfiguration com.ss.avframework.live.VeLivePusherDef.VeLiveAudioEncoderConfiguration.setProfile(VeLiveAudioProfile profile)
设置推流音频编码类型。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| profile | VeLiveAudioProfile | 推流音频编码类型,默认值为 VeLiveAudioAACProfileLC,详情请参见 VeLiveAudioProfile。 |
返回值
推流音频编码参数配置对象,详情请参见 VeLiveAudioEncoderConfiguration。
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioMixType
音频混流类型。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveAudioMixPush | 0 | 拉流端可以听到混音效果,本地无法听到。 |
| VeLiveAudioMixPlayAndPush | 1 | 拉流端和本地都可以听到混音效果。 |
public enum com.ss.avframework.live.VeLivePusherDef.VeLiveAudioCaptureType
音频采集类型。
| 类型 | 值 | 说明 |
|---|---|---|
| VeLiveAudioCaptureMicrophone | 0 | 使用默认麦克风设备进行音频采集。 |
| VeLiveAudioCaptureVoiceCommunication | 1 | 使用语音通话模式进行音频采集,此模式下会启动硬件的 3A 功能,即自动增益控制、自动频率控制和自动噪声抑制。 |
| VeLiveAudioCaptureExternal | 2 | 使用外部设备或源进行音频采集。 |
| VeLiveAudioCaptureMuteFrame | 3 | 使用静音帧作为音频源。 |