``` private void initOption() { //最大缓冲大小,默认值15*1024*1024即15M optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "max-buffer-size", 100 * 1024)); //最大缓存时长 //optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "max_cached_duration", 3)); //设置播放前的探测时间 1,达到首屏秒开效果 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "analyzeduration", 1)); //播放前的探测Size,默认是1M, 改小一点会出画面更快 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "probesize", 1024 * 10)); //根据IjkPlayer起播速度优化:https://cloud.tencent.com/developer/article/1357997 添加 //跳过循环滤波; 0 开启,画面质量高,解码开销大; 48 关闭, 画面质量差,解码开销小 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_CODEC,"skip_loop_filter",48)); //设置最长分析时长 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "analyzemaxduration", 100)); //通过立即清理数据包来减少等待时长 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "flush_packets", 1)); //暂停输出直到停止后读取足够的数据包,buffering方法不再执行 //optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "packet-buffering", 0)); //网络不好的情况下进行丢包 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "framedrop", 1)); //不查询stream_info,直接使用 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER,"find_stream_info", 0)); //等待开始之后才绘制 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "render-wait-start", 1)); //设置停止预读取的最小帧数,范围2~50000,默认值50000 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "min-frames", 100)); //设置第一次唤醒read_thread线程的时间(毫秒),范围100~5000,默认值100 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "first-high-water-mark-ms", 100)); //设置下一次唤醒read_thread线程的时间(毫秒),范围100~5000,默认值1000 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "next-high-water-mark-ms", 1000)); //设置最后一次唤醒read_thread线程的时间(毫秒),范围100~5000,默认值5000 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "last-high-water-mark-ms", 5000)); //SeekTo设置优化 optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "enable-accurate-seek", 1)); //seek 默认超时时间5*1000 ms optionModels.add(new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "accurate-seek-timeout", 500)); } ``` Docker镜像配置 OPENGL GLSL内建函数
No Leanote account? Sign up now.