VHLivePushConfig 发直播参数配置类

类名

VHLivePushConfig

方法

1、 构造方法

/**
 * 配合发起直播的参数
 * @Param type 发起直播的分辨率
 * @Param VHLivePushFormat.PUSH_MODE_SD // 低分辨率     352*288
 * @Param VHLivePushFormat.PUSH_MODE_HD // 普通分辨率   640*480 (默认)
 * @Param VHLivePushFormat.PUSH_MODE_XHD // 高分辨率    960*540
 * @Param VHLivePushFormat.PUSH_MODE_XXHD // 超高分辨率 1280*720
 */
public VHLivePushConfig(int type) {}

成员变量

1、 设置编码方式

/**
 * 编解码方式
 * @Param VHLivePushFormat.ENCODE_TYPE_SOFT // 软编 (默认)
 * @Param VHLivePushFormat.ENCODE_TYPE_HARD // 硬编
 * @Param VHLivePushFormat.ENCODE_TYPE_AUTO // 自动
 */
config.encodeType = VHLivePushFormat.ENCODE_TYPE_HARD;

2、 设置横竖屏

/**
 * 横竖屏设置 (这个必须配置)
 * @Param VHLivePushFormat.SCREEN_ORI_LANDSPACE // 横屏
 * @Param VHLivePushFormat.SCREEN_ORI_PORTRAIT //  竖屏
 */
config.screenOri = VHLivePushFormat.SCREEN_ORI_PORTRAIT;

3、 设置码率

/**
 * 码率 默认400 * 1000
 */
config.videoBitrate = 400 * 1000;

4、 设置帧率

/**
 * 帧率 默认15帧
 */
config.videoFrameRate = 15;

5、 设置发起超时时间

/**
 * 发起超时时间 默认5秒
 */
config.pushTimeout = 5 * 1000;

6、 设置重连次数

/**
 * 重连次数 默认5次
 */
config.pushReconnectTimes = 5 ;

7、 设置推流方式

/**
 * 推流方式 默认RTMP
 */
config.streamMode = VHLivePushFormat.STREAM_MODE_RTMP ;