update camera encoder

This commit is contained in:
linbo 2026-03-17 15:57:46 +08:00
parent e537194897
commit 23fdde3730

View File

@ -884,7 +884,7 @@ bool RealsenseCamera::initSingleEncoder(std::shared_ptr<FfmpegEncoderInfo>& enco
ctx->time_base = {1, fps}; // 时间基1/fps
ctx->framerate = {fps, 1}; // 帧率
ctx->max_b_frames = 0; // 禁用B帧降低延迟
ctx->gop_size = 10;//I帧间隔1每一帧都是I帧
ctx->gop_size = 10;//I帧间隔
// 5. 设置编码器私有参数
if (codec->id == AV_CODEC_ID_H264) {
av_opt_set(ctx->priv_data, "preset", "ultrafast", 0);
@ -903,6 +903,7 @@ bool RealsenseCamera::initSingleEncoder(std::shared_ptr<FfmpegEncoderInfo>& enco
"min-keyint=%d:" // 最小关键帧间隔
"no-open-gop=1:" // 禁用开放GOP
"bframes=0:" // 禁用B帧
"lookahead=0:"
"log-level=none", // 日志级别
10, 10); // 设置keyint和min-keyint为10