如下图场景,图像1920*1080大小,配置码率为2M。
大场景时,实际码率与配置码率基本匹配。
变焦至小场景,当风吹过树叶,画面运动量很大时,图像的码率会很大,会达到10M左右,视频可能会卡顿或者花屏,CBR与VBR均不能降低码率。
请问:有没有好方法来控制码率?谢谢。
Chris Meng:
你好,
请问使用的是哪款芯片?
Free:
回复 Chris Meng:
你好,我们使用的是APPRO DM8127 IPNC,RDK3.8。
设置了I帧与P帧的QPmax值,码率可以降一些,但有时候还是控制不住。
Chris Meng:
回复 Free:
你好,
CBR可以通过丢帧来保证码率,但会出现卡顿现象。
VBR在运动较大的时候码率增加是正常现象。
你是否使用的是HP? HP支持的选项是否都使能了?QPmax设置为51了?
Free:
回复 Chris Meng:
你好,我使用的是HP,动态参数请见下面。
QPmax设置为51时,码率控制的较好,图像质量也下降的厉害,马赛克明显:
1、设置为2M码率,小场景多运动画面,最大会升到5M左右。
2、返回大场景时,码率变得比较小,只有500K左右,画面跳动,需要较长时间回到2M。
下面是264的动态参数配置,麻烦看看有什么改进的地方,谢谢。
另:QP值是不是可以根据码率动态调整?如何实时统计视频码率以决定跳帧或改变QP?谢谢。
[m3video] ——— CH 0 : H264 ENC : Dynamic Params ——-[m3video] [m3video] videnc2DynamicParams -> inputHeight : 1080[m3video] videnc2DynamicParams -> inputWidth : 1920[m3video] videnc2DynamicParams -> refFrameRate : 25000[m3video] videnc2DynamicParams -> targetFrameRate : 25000[m3video] videnc2DynamicParams -> targetBitRate : 2000000[m3video] videnc2DynamicParams -> intraFrameInterval : 30[m3video] videnc2DynamicParams -> generateHeader : 0[m3video] videnc2DynamicParams -> captureWidth : 1952[m3video] videnc2DynamicParams -> forceFrame : -1[m3video] videnc2DynamicParams -> interFrameInterval : 1[m3video] videnc2DynamicParams -> mvAccuracy : 2[m3video] videnc2DynamicParams -> sampleAspectRatioHeight : 1080[m3video] videnc2DynamicParams -> sampleAspectRatioWidth : 1920[m3video] videnc2DynamicParams -> ignoreOutbufSizeFlag : 1[m3video] videnc2DynamicParams -> lateAcquireArg : 0[m3video] [m3video] rateControlParams -> rateControlParamsPreset : 1[m3video] rateControlParams -> scalingMatrixPreset : 1[m3video] rateControlParams -> rcAlgo : 0[m3video] rateControlParams -> qpI : -1[m3video] rateControlParams -> qpMaxI : 46[m3video] rateControlParams -> qpMinI : 10[m3video] rateControlParams -> qpP : 28[m3video] rateControlParams -> qpMaxP : 51[m3video] rateControlParams -> qpMinP : 10[m3video] rateControlParams -> qpOffsetB : 0[m3video] rateControlParams -> qpMaxB : 40[m3video] rateControlParams -> qpMinB : 40[m3video] rateControlParams -> allowFrameSkip : 0[m3video] rateControlParams -> removeExpensiveCoeff : 0[m3video] rateControlParams -> chromaQPIndexOffset : 0[m3video] rateControlParams -> IPQualityFactor : 0[m3video] rateControlParams -> initialBufferLevel : 4000000[m3video] rateControlParams -> HRDBufferSize : 4000000[m3video] rateControlParams -> minPicSizeRatioI : 0[m3video] rateControlParams -> maxPicSizeRatioI : 960[m3video] rateControlParams -> minPicSizeRatioP : 0[m3video] rateControlParams -> maxPicSizeRatioP : 0[m3video] rateControlParams -> minPicSizeRatioB : 0[m3video] rateControlParams -> maxPicSizeRatioB : 0[m3video] rateControlParams -> enablePRC : 1[m3video] rateControlParams -> enablePartialFrameSkip : 0[m3video] rateControlParams -> discardSavedBits : 1[m3video] rateControlParams -> VBRDuration : 8[m3video] rateControlParams -> VBRsensitivity : 0[m3video] rateControlParams -> skipDistributionWindowLength: 5[m3video] rateControlParams -> numSkipInDistributionWindow : 1[m3video] rateControlParams -> enableHRDComplianceMode : 1[m3video] rateControlParams -> frameSkipThMulQ5 : 0[m3video] rateControlParams -> vbvUseLevelThQ5 : 0[m3video] [m3video] interCodingParams-> interCodingPreset : 1[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 : 1[m3video] interCodingParams-> minBlockSizeB : 1[m3video] interCodingParams-> meAlgoMode : 0[m3video] [m3video] intraCodingParams-> intraCodingPreset : 1[m3video] intraCodingParams-> lumaIntra4x4Enable : 0[m3video] intraCodingParams-> lumaIntra8x8Enable : 255[m3video] intraCodingParams-> lumaIntra8x8Enable : 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-> constrainedIntraPredEnable : 0[m3video] [m3video] nalUnitControlParams -> naluControlPreset : 1[m3video] nalUnitControlParams -> naluPresentMaskStartOfSequence : 8608[m3video] nalUnitControlParams -> naluPresentMaskIDRPicture : 8672[m3video] nalUnitControlParams -> naluPresentMaskIntraPicture : 8450[m3video] nalUnitControlParams -> naluPresentMaskNonIntraPicture : 2[m3video] nalUnitControlParams -> naluPresentMaskEndOfSequence : 3072[m3video] [m3video] sliceCodingParams-> sliceCodingPreset : 1[m3video] sliceCodingParams-> sliceMode : 0[m3video] sliceCodingParams-> sliceUnitSize : 0[m3video] sliceCodingParams-> sliceStartOffset[IH264ENC_MAX_NUM_SLICE_START_OFFSET] : 0 0 0[m3video] sliceCodingParams-> streamFormat : 0[m3video] [m3video] loopFilterParams-> loopfilterPreset : 0[m3video] loopFilterParams-> loopfilterDisableIDC : 0[m3video] loopFilterParams-> filterOffsetA : 0[m3video] loopFilterParams-> filterOffsetB : 0[m3video] [m3video] fmoCodingParams-> fmoCodingPreset : 0[m3video] fmoCodingParams-> numSliceGroups : 1[m3video] fmoCodingParams-> liceGroupMapType : 4[m3video] fmoCodingParams-> liceGroupChangeDirectionFlag : 0[m3video] fmoCodingParams-> liceGroupChangeRate : 0[m3video] fmoCodingParams-> sliceGroupChangeCycle : 0[m3video] fmoCodingParams-> sliceGroupParams : [0 0] [m3video] [m3video] vuiCodingParams-> vuiCodingPreset : 1[m3video] vuiCodingParams-> aspectRatioInfoPresentFlag : 0[m3video] vuiCodingParams-> aspectRatioIdc : 255[m3video] vuiCodingParams-> videoSignalTypePresentFlag : 1[m3video] vuiCodingParams-> videoFormat : 5[m3video] vuiCodingParams-> videoFullRangeFlag : 1[m3video] vuiCodingParams-> timingInfoPresentFlag : 1[m3video] vuiCodingParams-> hrdParamsPresentFlag : 1[m3video] vuiCodingParams-> numUnitsInTicks : 1000[m3video] [m3video] stereoInfoParams-> stereoInfoPreset : 0[m3video] stereoInfoParams-> topFieldIsLeftViewFlag : 1[m3video] stereoInfoParams-> viewSelfContainedFlag : 0[m3video] [m3video] framePackingSEIParams-> framePackingPreset : 0[m3video] framePackingSEIParams-> framePackingType : 3[m3video] framePackingSEIParams-> frame0PositionX : 0[m3video] framePackingSEIParams-> frame0PositionY : 0[m3video] framePackingSEIParams-> frame1PositionX : 0[m3video] framePackingSEIParams-> frame1PositionY : 0[m3video] [m3video] svcCodingParams-> svcExtensionFlag : 0[m3video] svcCodingParams-> dependencyID : 0[m3video] svcCodingParams-> qualityID : 0[m3video] svcCodingParams-> enhancementProfileID : 0[m3video] svcCodingParams-> layerIndex : 0[m3video] svcCodingParams-> refLayerDQId : 0[m3video] [m3video] interlaceCodingType : 3[m3video] bottomFieldIntra : 0[m3video] gopStructure : 0[m3video] entropyCodingMode : 1[m3video] transformBlockSize : 1[m3video] log2MaxFNumMinus4 : 10[m3video] picOrderCountType : 0[m3video] enableWatermark : 0[m3video] IDRFrameInterval : 1[m3video] maxIntraFrameInterval : 60[m3video] debugTraceLevel : 1[m3video] lastNFramesToLog : 31[m3video] enableAnalyticinfo : 1[m3video] enableGMVSei : 0[m3video] constraintSetFlags : 0[m3video] enableRCDO : 0[m3video] enableLongTermRefFrame : 0[m3video] LTRPPeriod : 0[m3video] searchCenter : 32767[m3video] enableStaticMBCount : 0[m3video] extMemoryDebugTraceAddr : -1171076224[m3video] numTemporalLayer : 1[m3video] referencePicMarking: 1[m3video] extMemoryDebugTraceSize : 43008[m3video] enableROI : 0[m3video] [m3video]
Free:
回复 Chris Meng:
好的,非常感谢。