下面是一个 JSON 格式的配置文件,其中包含了视频编码器的相关参数配置。可以看到该文件中有一些通用的参数配置,如视频流保存路径、编码分辨率等;同时也包含了 Mjpeg、H264 和 H265 三种编码器的参数配置。此外,还有 OSD 的相关配置,可以添加一个或多个图片作为叠加显示。
{
"mpp_enc_cfg": {
"version" : "v1.8",
"common" : {
"param_init": {
"fbc": "off",
"split_mode": "none",
"split_arg": 0,
"force_idr_count": 5,
"force_idr_period": 5,
"frc_fps": 0,
"frc_mode": 2,
"stream_save_dir": "data",
"rotation": 0
},
"param_change": {
}
},
"mjpeg": {
"param_init": {
"quant": 9,
"range": "full",
"qfactor": 85,
"qfactor_frc_min": 70,
"rc_mode": "fixqp",
"framerate": 0,
"sei": "off",
"bps": 150000000,
"enc_mode": 0,
"1920*1080p60": {
"qfactor": 80,
"qfactor_frc_min": 65
},
"3840*2160p25": {
"qfactor": 70,
"qfactor_frc_min": 50
},
"3840*2160p30": {
"qfactor": 60,
"qfactor_frc_min": 40
}
},
"param_change": {
}
},
"h264" : {
"param_init": {
"gop": 60,
"rc_mode": "cbr",
"rc_quality": "best",
"framerate": 0,
"range": "full",
"head_each_idr": "on",
"sei": "off",
"qp_init": 26,
"qp_max": 48,
"qp_min": 8,
"qp_step": 8,
"profile": 100,
"cabac_en": 1,
"cabac_idc": 0,
"trans_8x8": 1,
"level": 41,
"vi_len": 30,
"gop_mode": 0,
"bps": 10485760,
"force_idr_bps": 20485760,
"1920*1080p30": {
"bps": 10485760,
"force_idr_bps": 30485760
},
"3840*2160p30": {
"bps": 20485760,
"force_idr_bps": 50485760
}
},
"param_change": {
}
},
"h265" : {
"param_init": {
"gop": 60,
"rc_mode": "cbr",
"rc_quality": "best",
"framerate": 0,
"range": "full",
"head_each_idr": "on",
"sei": "off",
"qp_init": 24,
"qp_max": 51,
"qp_min": 10,
"qp_step": 4,
"max_i_qp": 46,
"min_i_qp": 24,
"vi_len": 30,
"gop_mode": 0,
"bps": 10485760,
"force_idr_bps": 20485760,
"1920*1080p30": {
"bps": 10485760,
"force_idr_bps": 30485760
},
"3840*2160p30": {
"bps": 20485760,
"force_idr_bps": 50485760
}
},
"param_change": {
}
},
"osd" : {
"enable": "off",
"count": 2,
"plt_user": 1,
"osd_0": {
"type" :"picture",
"enable" : "on",
"1280*720": {
"path" : "/data/osd_0.bmp",
"start_x": 0.65,
"start_y": 0.85
},
"1920*1080": {
"path" : "/data/osd_0.bmp",
"start_x": 0.75,
"start_y": 0.9
},
"3840*2160": {
"path" : "/data/osd_0.bmp",
"start_x": 0.8,
"start_y": 0.8
},
"common": {
"path" : "/data/osd_0.bmp",
"start_x": 0.8,
"start_y": 0.8
}
},
"osd_1": {
"type" :"picture",
"enable" : "on",
"1280*720": {
"path" : "/data/osd_1.bmp",
"start_x": 0.0,
"start_y": 0.0
},
"1920*1080": {
"path" : "/data/osd_1.bmp",
"start_x": 0.0,
"start_y": 0.0
},
"3840*2160": {
"path" : "/data/osd_1.bmp",
"start_x": 0.0,
"start_y": 0.0
},
"common": {
"path" : "/data/osd_1.bmp",
"start_x": 0.0,
"start_y": 0.0
}
}
}
}
}
“mjpeg”: {
“param_init”: {
“quant”: 9, //设置量化因子,取值范围为 0-255,数值越小表示质量越高。
“range”: “full”, //设置颜色范围,可选值为 “full” 或 “limited”。
“qfactor”: 85, //设置质量因子,取值范围为 0-100,数值越高表示质量越好。
“qfactor_frc_min”: 70, //设置 FRC 最小质量因子,取值范围为 0-100。
“rc_mode”: “fixqp”, //设置码率控制模式,可选值为 “fixqp” 或 “vbr”。
“framerate”: 0, //设置帧率,单位为帧/秒。
“sei”: “off”, //是否启用 SEI (Supplemental Enhancement Information),可选值为 “on” 或 “off”。
“bps”: 150000000, //设置目标比特率,单位为比特/秒。
“enc_mode”: 0, //设置编码模式,可选值为 0 或 1。
“19201080p60": { //针对分辨率为 1920x1080、帧率为 60 帧/秒的视频流的参数设置。
“qfactor”: 80,
“qfactor_frc_min”: 65
},
"38402160p25”: { //针对分辨率为 3840x2160、帧率为 25 帧/秒的视频流的参数设置。
“qfactor”: 70,
“qfactor_frc_min”: 50
},
“3840*2160p30”: { //针对分辨率为 3840x2160、帧率为 30 帧/秒的视频流的参数设置。
“qfactor”: 60,
“qfactor_frc_min”: 40
}
},
“param_change”: {
}
},