输入帧率和参考帧率设成30000,把I帧间隔设置为30或者大于30的时候,编码器可以正常编码,但是当把I帧间隔设置为小于30的时候(其他参数不变),编码器报错。
之前我们用的DVRRDK_03.50.00.05版本是没有这个问题的,
我们想确认一下,04.01.00.02这个版本里的H264编码器的I帧间隔是不是不能设置为小于30呢?
user1369122:
没有听说啊,你把编码库互换下实验看看
Ternence_Hsu:
你好;
在4.01的版本中是没有这个限制的,具体的问题你可以查查其他地方;
你可以贴出你的编码器报错的错误log信息来;
bee:
回复 Ternence_Hsu:
你好,
编码器正常工作的时候,encLink的参数设置如下:
encPrm.chCreateParams[i].format = IVIDEO_H264HP;
encPrm.chCreateParams[i].profile = IH264_HIGH_PROFILE;
encPrm.chCreateParams[i].dataLayout = IVIDEO_FIELD_SEPARATED;//IVIDEO_FIELD_INTERLEAVED;//progressive ignore the param encPrm.chCreateParams[i].fieldMergeEncodeEnable = FALSE;
encPrm.chCreateParams[i].maxBitRate = 10000000;
encPrm.chCreateParams[i].enableHighSpeed = 0;
encPrm.chCreateParams[i].encodingPreset = XDM_USER_DEFINED;
encPrm.chCreateParams[i].enableAnalyticinfo = 0;
encPrm.chCreateParams[i].enableWaterMarking = 0;
encPrm.chCreateParams[i].rateControlPreset = IVIDEO_LOW_DELAY;
encPrm.chCreateParams[i].defaultDynamicParams.inputFrameRate = 30000;
encPrm.chCreateParams[i].defaultDynamicParams.targetBitRate = 8000000;
encPrm.chCreateParams[i].defaultDynamicParams.intraFrameInterval = 30;
encPrm.chCreateParams[i].defaultDynamicParams.interFrameInterval = 1;//bFrameInterval[i];// 1: no B frame.
encPrm.chCreateParams[i].defaultDynamicParams.mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
encPrm.chCreateParams[i].defaultDynamicParams.rcAlg = IH264_RATECONTROL_PRC_LOW_DELAY;//IH264_RATECONTROL_PRC; encPrm.chCreateParams[i].defaultDynamicParams.qpMin = 10; //20
encPrm.chCreateParams[i].defaultDynamicParams.qpMax = 50;//51;//
encPrm.chCreateParams[i].defaultDynamicParams.qpInit = 28;//-1;//
encPrm.chCreateParams[i].defaultDynamicParams.vbrDuration = 8;
encPrm.chCreateParams[i].defaultDynamicParams.vbrSensitivity = 0;
encPrm.numBufPerCh[i] = 6;
输出的参数如下:
[m3video] ——— CH 0 : H264 ENC : Dynamic Params ——-
[m3video] [m3video] videnc2DynamicParams -> inputHeight : 1080
[m3video] videnc2DynamicParams -> inputWidth : 1920
[m3video] videnc2DynamicParams -> refFrameRate : 30000
[m3video] videnc2DynamicParams -> targetFrameRate : 30000
[m3video] videnc2DynamicParams -> targetBitRate : 8000000
[m3video] videnc2DynamicParams -> intraFrameInterval : 30
[m3video] videnc2DynamicParams -> generateHeader : 0
[m3video] videnc2DynamicParams -> captureWidth : 1920
[m3video] videnc2DynamicParams -> forceFrame : -1
[m3video] videnc2DynamicParams -> interFrameInterval : 1
[m3video] videnc2DynamicParams -> mvAccuracy : 2
[m3video] videnc2DynamicParams -> sampleAspectRatioHeight : 1
[m3video] videnc2DynamicParams -> sampleAspectRatioWidth : 1
[m3video] videnc2DynamicParams -> ignoreOutbufSizeFlag : 1
[m3video] videnc2DynamicParams -> lateAcquireArg : -1
[m3video] [m3video] rateControlParams -> rateControlParamsPreset : 1
[m3video] rateControlParams -> scalingMatrixPreset : 1
[m3video] rateControlParams -> rcAlgo : 1
[m3video] rateControlParams -> qpI : 28
[m3video] rateControlParams -> qpMaxI : 50
[m3video] rateControlParams -> qpMinI : 10
[m3video] rateControlParams -> qpP : 28
[m3video] rateControlParams -> qpMaxP : 50
[m3video] rateControlParams -> qpMinP : 10
[m3video] rateControlParams -> qpOffsetB : 4
[m3video] rateControlParams -> qpMaxB : 44
[m3video] rateControlParams -> qpMinB : 10
[m3video] rateControlParams -> allowFrameSkip : 0
[m3video] rateControlParams -> removeExpensiveCoeff : 0
[m3video] rateControlParams -> chromaQPIndexOffset : 0
[m3video] rateControlParams -> IPQualityFactor : 0
[m3video] rateControlParams -> initialBufferLevel : 8000000
[m3video] rateControlParams -> HRDBufferSize : 8000000
[m3video] rateControlParams -> minPicSizeRatioI : 0
[m3video] rateControlParams -> maxPicSizeRatioI : 640
[m3video] rateControlParams -> minPicSizeRatioP : 0
[m3video] rateControlParams -> maxPicSizeRatioP : 0
[m3video] rateControlParams -> minPicSizeRatioB : 0
[m3video] rateControlParams -> maxPicSizeRatioB : 0
[m3video] rateControlParams -> enablePRC : 0
[m3video] rateControlParams -> enablePartialFrameSkip : 0
[m3video] rateControlParams -> discardSavedBits : 1
[m3video] rateControlParams -> VBRDuration : 8
[m3video] rateControlParams -> VBRsensitivity : 0
[m3video] rateControlParams -> skipDistributionWindowLength : 5
[m3video] rateControlParams -> numSkipInDistributionWindow : 2
[m3video] rateControlParams -> enableHRDComplianceMode : 1
[m3video] rateControlParams -> frameSkipThMulQ5 : 0
[m3video] rateControlParams -> vbvUseLevelThQ5 : 0
[m3video] [m3video] interCodingParams -> interCodingPreset : 0
[m3video] interCodingParams -> searchRangeHorP : 144
[m3video] interCodingParams -> searchRangeVerP : 32
[m3video] interCodingParams -> searchRangeHorB : 144
[m3video] interCodingParams -> searchRangeVerB : 16
[m3video] interCodingParams -> interCodingBias : 1
[m3video] interCodingParams -> skipMVCodingBias : 1
[m3video] interCodingParams -> minBlockSizeP : 0
[m3video] interCodingParams -> minBlockSizeB : 0
[m3video] interCodingParams -> meAlgoMode : 0
[m3video] [m3video] intraCodingParams -> intraCodingPreset : 0
[m3video] intraCodingParams -> lumaIntra4x4Enable : 0
[m3video] intraCodingParams -> lumaIntra8x8Enable : 255
[m3video] intraCodingParams -> lumaIntra16x16Enable : 15
[m3video] intraCodingParams -> chromaIntra8x8Enable : 15
[m3video] intraCodingParams -> chromaComponentEnable : 1
[m3video] intraCodingParams -> intraRefreshMethod : 0
[m3video] intraCodingParams -> intraRefreshRate : 0
[m3video] intraCodingParams -> gdrOverlapRowsBtwFrames : 0
[m3video] intraCodingParams -> constrainedIntraPredEnable : 0
[m3video] intraCodingParams -> intraCodingBias : 0
[m3video] [m3video] sliceCodingParams -> sliceCodingPreset : -96
[m3video] sliceCodingParams -> sliceMode : 8672
[m3video] sliceCodingParams -> sliceUnitSize : 139522
[m3video] sliceCodingParams -> sliceStartOffset : [0 12 -66]
[m3video] sliceCodingParams -> streamFormat : -66
[m3video] [m3video] sliceGroupChangeCycle : 0
[m3video] searchCenter : 0
[m3video] enableStaticMBCount : 0
[m3video] enableROI : 262400
上面的设置是I帧间隔是30,如果我把I帧间隔设置为10,也就是把
encPrm.chCreateParams[i].defaultDynamicParams.intraFrameInterval = 30;
这行改为
encPrm.chCreateParams[i].defaultDynamicParams.intraFrameInterval = 10;
其他的代码没有任何修改的时候,编码器报错,其输出的信息如下:
[m3video] 589584: ENCODE: Creating CH0 of 1920 x 1080, pitch = (1920, 1920) [PROGRESSIVE] [NON-TILED ], bitrate = 8000 Kbps, I-P Interval 1… [m3video] 589623:!ERROR!:ENCLINK::links_m3video/iva_enc/encLink_h264.c:[576]::INTERNAL ERROR:-1
[m3video] ALGCONTROL FAILED:CMD:1
[m3video] ERROR: IH264ENC_LEVEL_INCOMPLAINT_PARAMETER , 0,
[m3video] ERROR: IH264ENC_PROFILE_INCOMPLAINT_FMO_SETTING = 2,
[m3video] ERROR: IH264ENC_PROFILE_INCOMPLAINT_INTERFRAMEINTERVAL = 4,
[m3video] ERROR: XDM_UNSUPPORTEDPARAM = 14,
[m3video] ERROR: XDM_FATALERROR = 15
[m3video] 589624:!ERROR!:ENCLINK::links_m3video/iva_enc/encLink_h264.c:[587]::INTERNAL ERROR:-1
[m3video] Ext Error :0
[m3video] EXT_ERROR: IH264ENC_EXTERROR_RATECTRL_IFRAMEPICSIZE = 102
[m3video] 589624:!ERROR!:ENCLINK::links_m3video/iva_enc/encLink_h264.c:[587]::INTERNAL ERROR:-1
[m3video] Ext Error :0 [m3video] EXT_ERROR: IH264ENC_EXTERROR_LEVEL_INPCONTENT = 70
[m3video] EXT_ERROR: IH264ENC_EXTERROR_STEREO_PRESET = 130
[m3video] EXT_ERROR: IH264ENC_EXTERROR_VERSION_BUFFER_NULL_OR_SIZE = 131
[m3video] EXT_ERROR: IH264ENC_EXTERROR_VUI_NUMUNITSINTICKS = 132
[m3video] EXT_ERROR: IH264ENC_EXTERROR_VUI_PRESET = 133
[m3video] EXT_ERROR: ?
[m3video] 589626:!ERROR!:ENCLINK::links_m3video/iva_enc/encLink_h264.c:[587]::INTERNAL ERROR:-1
[m3video] Ext Error :0 [m3video] EXT_ERROR: IH264ENC_EXTERROR_GENHEADER_BITSTREAM_BUFFERSIZE = 38
[m3video] EXT_ERROR: IH264ENC_EXTERROR_RATECTRL_BFRAMEPICSIZE = 98
[m3video] EXT_ERROR: IH264ENC_EXTERROR_RATECTRL_CBCRQPINDEX_INITBUFLVL = 99
[m3video] EXT_ERROR: IH264ENC_EXTERROR_RATECTRL_HRDBUFFER_LVLEXCEED = 100
[m3video] EXT_ERROR: IH264ENC_EXTERROR_RATECTRL_IFRAME_QP = 101
[m3video] EXT_ERROR: IH264ENC_EXTERROR_SCLMATRIX_METADATA = 104
[m3video] EXT_ERROR: IH264ENC_EXTERROR_STATUS_SIZE = 128
[m3video] EXT_ERROR: IH264ENC_EXTERROR_STEREO_INPCONTENT = 129
[m3video] 589627:!ERROR!:ENCLINK::links_m3video/iva_enc/encLink_h264.c:[587]::INTERNAL ERROR:-1 [m3video] Ext Error :40
[m3video] EXT_ERROR: IH264ENC_EXTERROR_CREATE_ENTROPY_PROFILE = 6
[m3video] EXT_ERROR: IH264ENC_EXTERROR_INTRA_REFRESHRATE = 66
[m3video] EXT_ERROR: IH264ENC_EXTERROR_IVAHD_BADRESET = 67
[m3video] EXT_ERROR: IH264ENC_EXTERROR_IVAHD_BADSTATE = 68
[m3video] EXT_ERROR: IH264ENC_EXTERROR_IVAHD_RELEASE = 69
[m3video] EXT_ERROR: IH264ENC_EXTERROR_LOOPFILTER_OFFST_LFIDC = 72
[m3video] EXT_ERROR: IH264ENC_EXTERROR_PROFILE_DATASYNC_INPCONTENT_RES = 96 [m3video] EXT_ERROR: IH264ENC_EXTERROR_PROFILE_INPCONTENT = 97
[m3video] EXT_ERROR: IH264ENC_EXTERROR_STATUS_SIZE = 128
[m3video] EXT_ERROR: IH264ENC_EXTERROR_STEREO_PRESET = 130
[m3video] 589630:!ERROR!:ENCLINK::links_m3video/iva_enc/encLink_h264.c:[587]::INTERNAL ERROR:-1 [m3video] Ext Error :0
[m3video] EXT_ERROR: IH264ENC_EXTERROR_FMO_PRESET = 34
[m3video] EXT_ERROR: IH264ENC_EXTERROR_FRMPACKING_PRESET = 35
[m3video] EXT_ERROR: IH264ENC_EXTERROR_FRMPACKING_TYPE_INPCONTENT = 36
[m3video] EXT_ERROR: IH264ENC_EXTERROR_FRMRATE_NUMUNITSINTICKS = 37
[m3video] EXT_ERROR: IH264ENC_EXTERROR_HIGHSPEED_BFARME = 40
[m3video] EXT_ERROR: IH264ENC_EXTERROR_INTRA_REFRESHMETHOD = 64
[m3video] EXT_ERROR: IH264ENC_EXTERROR_INTRA_REFRESHMETHOD_RATE = 65
[m3video] EXT_ERROR: IH264ENC_EXTERROR_PROFILE_DATASYNC_INPCONTENT_RES = 96 [m3video] EXT_ERROR: IH264ENC_EXTERROR_RATECTRL_BFRAMEPICSIZE = 98
[m3video] EXT_ERROR: IH264ENC_EXTERROR_VERSION_BUFFER_NULL_OR_SIZE = 131
[m3video] EXT_ERROR: IH264ENC_EXTERROR_VUI_NUMUNITSINTICKS = 132
[m3video] EXT_ERROR: IH264ENC_EXTERROR_VUI_PRESET = 133
[m3video] EXT_ERROR:
[m3video]
[m3video] ——— CH 0 : H264 ENC : Dynamic Params ——-
[m3video] [m3video] videnc2DynamicParams -> inputHeight : 1080
[m3video] videnc2DynamicParams -> inputWidth : 1920
[m3video] videnc2DynamicParams -> refFrameRate : 30000
[m3video] videnc2DynamicParams -> targetFrameRate : 30000
[m3video] videnc2DynamicParams -> targetBitRate : 8000000
[m3video] videnc2DynamicParams -> intraFrameInterval : 10
[m3video] videnc2DynamicParams -> generateHeader : 0
[m3video] videnc2DynamicParams -> captureWidth : 1920
[m3video] videnc2DynamicParams -> forceFrame : -1
[m3video] videnc2DynamicParams -> interFrameInterval : 1
[m3video] videnc2DynamicParams -> mvAccuracy : 2
[m3video] videnc2DynamicParams -> sampleAspectRatioHeight : 1
[m3video] videnc2DynamicParams -> sampleAspectRatioWidth : 1
[m3video] videnc2DynamicParams -> ignoreOutbufSizeFlag : 1
[m3video] videnc2DynamicParams -> lateAcquireArg : -1
[m3video] [m3video] rateControlParams -> rateControlParamsPreset : 1
[m3video] rateControlParams -> scalingMatrixPreset : 1
[m3video] rateControlParams -> rcAlgo : 1
[m3video] rateControlParams -> qpI : 28
[m3video] rateControlParams -> qpMaxI : 50
[m3video] rateControlParams -> qpMinI : 10
[m3video] rateControlParams -> qpP : 28
[m3video] rateControlParams -> qpMaxP : 50
[m3video] rateControlParams -> qpMinP : 10
[m3video] rateControlParams -> qpOffsetB : 4
[m3video] rateControlParams -> qpMaxB : 44
[m3video] rateControlParams -> qpMinB : 10
[m3video] rateControlParams -> allowFrameSkip : 0
[m3video] rateControlParams -> removeExpensiveCoeff : 0
[m3video] rateControlParams -> chromaQPIndexOffset : 0
[m3video] rateControlParams -> IPQualityFactor : 0
[m3video] rateControlParams -> initialBufferLevel : 8000000
[m3video] rateControlParams -> HRDBufferSize : 8000000
[m3video] rateControlParams -> minPicSizeRatioI : 0
[m3video] rateControlParams -> maxPicSizeRatioI : 640
[m3video] rateControlParams -> minPicSizeRatioP : 0
[m3video] rateControlParams -> maxPicSizeRatioP : 0
[m3video] rateControlParams -> minPicSizeRatioB : 0
[m3video] rateControlParams -> maxPicSizeRatioB : 0
[m3video] rateControlParams -> enablePRC : 0
[m3video] rateControlParams -> enablePartialFrameSkip : 0
[m3video] rateControlParams -> discardSavedBits : 1
[m3video] rateControlParams -> VBRDuration : 8
[m3video] rateControlParams -> VBRsensitivity : 0
[m3video] rateControlParams -> skipDistributionWindowLength : 5
[m3video] rateControlParams -> numSkipInDistributionWindow : 2
[m3video] rateControlParams -> enableHRDComplianceMode : 1
[m3video] rateControlParams -> frameSkipThMulQ5 : 0
[m3video] rateControlParams -> vbvUseLevelThQ5 : 0
[m3video] [m3video] interCodingParams -> interCodingPreset : 0
[m3video] interCodingParams -> searchRangeHorP : 144
[m3video] interCodingParams -> searchRangeVerP : 32
[m3video] interCodingParams -> searchRangeHorB : 144
[m3video] interCodingParams -> searchRangeVerB : 16
[m3video] interCodingParams -> interCodingBias : 1
[m3video] interCodingParams -> skipMVCodingBias : 1
[m3video] interCodingParams -> minBlockSizeP : 0
[m3video] interCodingParams -> minBlockSizeB : 0
[m3video] interCodingParams -> meAlgoMode : 0
[m3video] [m3video] intraCodingParams -> intraCodingPreset : 0
[m3video] intraCodingParams -> lumaIntra4x4Enable : 0
[m3video] intraCodingParams -> lumaIntra8x8Enable : 255
[m3video] intraCodingParams -> lumaIntra16x16Enable : 15
[m3video] intraCodingParams -> chromaIntra8x8Enable : 15
[m3video] intraCodingParams -> chromaComponentEnable : 1
[m3video] intraCodingParams -> intraRefreshMethod : 0
[m3video] intraCodingParams -> intraRefreshRate : 0
[m3video] intraCodingParams -> gdrOverlapRowsBtwFrames : 0
[m3video] intraCodingParams -> constrainedIntraPredEnable : 0
[m3video] intraCodingParams -> intraCodingBias : 0
[m3video] [m3video] sliceCodingParams -> sliceCodingPreset : 0
[m3video] sliceCodingParams -> sliceMode : 0
[m3video] sliceCodingParams -> sliceUnitSize : 0
[m3video] sliceCodingParams -> sliceStartOffset : [0 0 0]
[m3video] sliceCodingParams -> streamFormat : 0
[m3video] [m3video] sliceGroupChangeCycle : 0
[m3video] searchCenter : 32767
[m3video] enableStaticMBCount : 0
[m3video] enableROI : 0
bee:
回复 user1369122:
你好,DVRRDK3.50版本的H264编码库和DVRRDK4.01版本的H264编码库的接口有修改的地方,不能直接互换啊
Ternence_Hsu:
回复 bee:
你设置为baseline profile 编码测试一下,看这个问题是否有改善;
bee:
回复 Ternence_Hsu:
你好,
encPrm.chCreateParams[i].format = IVIDEO_H264HP;
encPrm.chCreateParams[i].profile = IH264_HIGH_PROFILE;
这两个参数修改为
encPrm.chCreateParams[i].format = IVIDEO_H264BP;
encPrm.chCreateParams[i].profile = IH264_BASELINE_PROFILE;
或者
encPrm.chCreateParams[i].format = IVIDEO_H264MP;
encPrm.chCreateParams[i].profile = IH264_MAIN_PROFILE;
或者
encPrm.chCreateParams[i].format = IVIDEO_H264HP;
encPrm.chCreateParams[i].profile = IH264_HIGH10_PROFILE;
都还是报错,没有改善。
bee:
回复 bee:
很郁闷的问题,
TI的工程师,能不能劳驾试一下,确认一下呀?
或者也在使用DVRRDK04.01.00.02的兄弟们,莫非大家在用H264编码的时候,I帧间隔都是大于30的?