This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

H.264 interlace encoding lost field when change GOP setting

Dear Experts,

We are using DM8148/DVR_RDK 3.5/REL.500.V.H264AVC.E.IVAHD.02.00.08.00.

Issue:
When we are encoding H.264 interlace mode, we will change GOP setting dynamically.
But sometimes when we change GOP setting (send command to M3Video), we will lost one filed.

Have any update of DM814x H.264 codec to solve this issue? or have any idea about this issue?

thx ~

HB

  • Hello,

    I am not aware with DVRRDK.

    You could check these guides:

    You could check the h264 encoder user guide for GOP.

    BR
    Margarita

  • Dear Margarita,

    Thx ~

    We checked document ~ 

    We know how to set run-time GOP configuration. (Setting_Dynamic_Parameters)

    But there is not related description about this issue.

    HB

  • Hello,

    Could you share your encoder settings?

    In additional, check this thread:
    e2e.ti.com/.../426680

    Regards,
    Margarita
  • Hi,

               Can you share the encoder configuration settings ??

    And also elaborate more on the issue like Which filed is lost (TF or BF). How GOP is changed ??

    If possible share the stream & explain the issue .

    Regards

    Gajanan

  • Dear Gajanan,

    In our investigation,
    1) About GOP dynamic params,
    Input interlace Video order: T1B1T2(GOP command occure)B2T3B3T4B4T5.....
    Out interlace video will become: (T1B1)T2(B2T3)(B3T4)(B4T5), (T#B#) means one frame. T2 cannot be decoded, which means T2 will be disappear in decoder side.

    2) Another dynamic params FPS also has problem.
    Input interlace Video order: T1B1(FPS command occure 60 fps -> 30 fps)T2B2T3B3T4B4T5B5.....
    Out interlace video will become: (T1B1)(T2T3)(T4T5). (T#T#) means one frame. This is unexpected result. Result should be (T1B1)(T3B3)(T5B5).

    Seems it is codec bug. Have any idea about this?

    Below is our setting:
    [ 195.574] [m3video]
    [ 195.574] [m3video] --------- CH 0 : H264 ENC : enclink_h264_print_status ( Dynamic Params ) -------
    [ 195.574] [m3video]
    [ 195.574] [m3video] videnc2DynamicParams -> inputHeight : 540
    [ 195.574] [m3video] videnc2DynamicParams -> inputWidth : 1920
    [ 195.574] [m3video] videnc2DynamicParams -> refFrameRate : 30000
    [ 195.574] [m3video] videnc2DynamicParams -> targetFrameRate : 30000
    [ 195.574] [m3video] videnc2DynamicParams -> targetBitRate : 6000000
    [ 195.574] [m3video] videnc2DynamicParams -> intraFrameInterval : 8
    [ 195.574] [m3video] videnc2DynamicParams -> generateHeader : 0
    [ 195.574] [m3video] videnc2DynamicParams -> captureWidth : 1920
    [ 195.574] [m3video] videnc2DynamicParams -> forceFrame : -1
    [ 195.574] [m3video] videnc2DynamicParams -> interFrameInterval : 1
    [ 195.574] [m3video] videnc2DynamicParams -> mvAccuracy : 2
    [ 195.575] [m3video] videnc2DynamicParams -> sampleAspectRatioHeight : 1
    [ 195.575] [m3video] videnc2DynamicParams -> sampleAspectRatioWidth : 1
    [ 195.575] [m3video] videnc2DynamicParams -> ignoreOutbufSizeFlag : 1
    [ 195.575] [m3video] videnc2DynamicParams -> lateAcquireArg : -1
    [ 195.575] [m3video]
    [ 195.575] [m3video] rateControlParams -> rateControlParamsPreset : 1
    [ 195.575] [m3video] rateControlParams -> scalingMatrixPreset : 0
    [ 195.575] [m3video] rateControlParams -> rcAlgo : 0
    [ 195.575] [m3video] rateControlParams -> qpI : -1
    [ 195.575] [m3video] rateControlParams -> qpMaxI : 51
    [ 195.575] [m3video] rateControlParams -> qpMinI : 10
    [ 195.575] [m3video] rateControlParams -> qpP : -1
    [ 195.575] [m3video] rateControlParams -> qpMaxP : 51
    [ 195.575] [m3video] rateControlParams -> qpMinP : 10
    [ 195.575] [m3video] rateControlParams -> qpOffsetB : 4
    [ 195.575] [m3video] rateControlParams -> qpMaxB : 44
    [ 195.575] [m3video] rateControlParams -> qpMinB : 10
    [ 195.575] [m3video] rateControlParams -> allowFrameSkip : 0
    [ 195.575] [m3video] rateControlParams -> removeExpensiveCoeff : 0
    [ 195.575] [m3video] rateControlParams -> chromaQPIndexOffset : 0
    [ 195.575] [m3video] rateControlParams -> IPQualityFactor : 0
    [ 195.575] [m3video] rateControlParams -> initialBufferLevel : 12000000
    [ 195.575] [m3video] rateControlParams -> HRDBufferSize : 12000000
    [ 195.576] [m3video] rateControlParams -> minPicSizeRatioI : 0
    [ 195.576] [m3video] rateControlParams -> maxPicSizeRatioI : 20
    [ 195.576] [m3video] rateControlParams -> minPicSizeRatioP : 0
    [ 195.576] [m3video] rateControlParams -> maxPicSizeRatioP : 20
    [ 195.576] [m3video] rateControlParams -> minPicSizeRatioB : 0
    [ 195.576] [m3video] rateControlParams -> maxPicSizeRatioB : 0
    [ 195.576] [m3video] rateControlParams -> enablePRC : 1
    [ 195.576] [m3video] rateControlParams -> enablePartialFrameSkip : 0
    [ 195.576] [m3video] rateControlParams -> discardSavedBits : 1
    [ 195.576] [m3video] rateControlParams -> VBRDuration : 8
    [ 195.576] [m3video] rateControlParams -> VBRsensitivity : 0
    [ 195.576] [m3video] rateControlParams -> skipDistributionWindowLength : 5
    [ 195.576] [m3video] rateControlParams -> numSkipInDistributionWindow : 2
    [ 195.576] [m3video] rateControlParams -> enableHRDComplianceMode : 1
    [ 195.576] [m3video] rateControlParams -> frameSkipThMulQ5 : 0
    [ 195.576] [m3video] rateControlParams -> vbvUseLevelThQ5 : 0
    [ 195.576] [m3video]
    [ 195.576] [m3video] interCodingParams -> interCodingPreset : 0
    [ 195.912] [c6xdsp ] This Core is alive:49120
    [ 195.913] [m3video] interCodingParams -> searchRangeHorP : 144
    [ 195.913] [m3video] interCodingParams -> searchRangeVerP : 32
    [ 195.913] [m3video] interCodingParams -> searchRangeHorB : 144
    [ 195.913] [m3video] interCodingParams -> searchRangeVerB : 16
    [ 195.913] [m3video] interCodingParams -> interCodingBias : 1
    [ 195.913] [m3video] interCodingParams -> skipMVCodingBias : 1
    [ 195.913] [m3video] interCodingParams -> minBlockSizeP : 0
    [ 195.913] [m3video] interCodingParams -> minBlockSizeB : 0
    [ 195.913] [m3video] interCodingParams -> meAlgoMode : 0
    [ 195.913] [m3video]
    [ 195.913] [m3video] intraCodingParams -> intraCodingPreset : 0
    [ 195.913] [m3video] intraCodingParams -> lumaIntra4x4Enable : 255
    [ 195.913] [m3video] intraCodingParams -> lumaIntra8x8Enable : 0
    [ 195.913] [m3video] intraCodingParams -> lumaIntra16x16Enable : 15
    [ 195.913] [m3video] intraCodingParams -> chromaIntra8x8Enable : 15
    [ 195.913] [m3video] intraCodingParams -> chromaComponentEnable : 1
    [ 195.913] [m3video] intraCodingParams -> intraRefreshMethod : 0
    [ 195.913] [m3video] intraCodingParams -> intraRefreshRate : 0
    [ 195.913] [m3video] intraCodingParams -> gdrOverlapRowsBtwFrames : 0
    [ 195.913] [m3video] intraCodingParams -> constrainedIntraPredEnable : 0
    [ 195.913] [m3video] intraCodingParams -> intraCodingBias : 0
    [ 195.913] [m3video]
    [ 195.913] [m3video] sliceCodingParams -> sliceCodingPreset : 0
    [ 195.914] [m3video] sliceCodingParams -> sliceMode : 0
    [ 195.914] [m3video] sliceCodingParams -> sliceUnitSize : 0
    [ 195.914] [m3video] sliceCodingParams -> sliceStartOffset : [0 0 0]
    [ 195.914] [m3video] sliceCodingParams -> streamFormat : 0
    [ 195.914] [m3video]
    [ 195.914] [m3video] searchCenter : 32767
    [ 195.914] [m3video] enableStaticMBCount : 0
    [ 195.914] [m3video] enableROI : 0
    [ 195.914] [m3video]
    [ 195.914] [m3video]
    [ 195.914] [m3video]
    [ 195.914] [m3video] --------- H264 ENC : Static Params -------
    [ 195.914] [m3video]
    [ 195.914] [m3video] videnc2Params -> encodingPreset : 3
    [ 195.914] [m3video] videnc2Params -> rateControlPreset : 5
    [ 195.914] [m3video] videnc2Params -> maxHeight : 540
    [ 195.914] [m3video] videnc2Params -> maxWidth : 1920
    [ 195.914] [m3video] videnc2Params -> maxInterFrameInterval : 1
    [ 195.914] [m3video] videnc2Params -> maxBitRate : 6000000
    [ 195.914] [m3video] videnc2Params -> minBitRate : 0
    [ 195.914] [m3video] videnc2Params -> inputChromaFormat : 9
    [ 195.914] [m3video] videnc2Params -> inputContentType : 1
    [ 195.914] [m3video] videnc2Params -> operatingMode : 1
    [ 195.914] [m3video] videnc2Params -> profile : 77
    [ 195.914] [m3video] videnc2Params -> level : 42
    [ 195.915] [m3video] videnc2Params -> inputDataMode : 3
    [ 195.915] [m3video] videnc2Params -> outputDataMode : 3
    [ 195.915] [m3video] videnc2Params -> numInputDataUnits : 1
    [ 195.915] [m3video] videnc2Params -> numOutputDataUnits : 1
    [ 195.915] [m3video] videnc2Params -> metadataType : 965438864
    [ 195.915] [m3video] videnc2Params -> fmoCodingParams.fmoCodingPreset : 0
    [ 195.915] [m3video] videnc2Params->interlaceCodingType : 3
    [ 195.915] [m3video] videnc2Params->bottomFieldIntra : 0
    [ 195.915] [m3video] videnc2Params->gopStructure : 0
    [ 195.915] [m3video] videnc2Params->entropyCodingMode : 1
    [ 196.251] [m3video] videnc2Params->transformBlockSize : 0
    [ 196.251] [m3video] videnc2Params->log2MaxFNumMinus4 : 10
    [ 196.251] [m3video] videnc2Params->picOrderCountType : 0
    [ 196.251] [m3video] videnc2Params->enableWatermark : 0
    [ 196.251] [m3video] videnc2Params->IDRFrameInterval : 1
    [ 196.251] [m3video] videnc2Params->pConstantMemory : 0
    [ 196.251] [m3video] videnc2Params->maxIntraFrameInterval : 2147483640
    [ 196.251] [m3video] videnc2Params->debugTraceLevel : 0
    [ 196.251] [m3video] videnc2Params->lastNFramesToLog : 0
    [ 196.251] [m3video] videnc2Params->enableAnalyticinfo : 0
    [ 196.251] [m3video] videnc2Params->enableGMVSei : 0
    [ 196.251] [m3video] videnc2Params->constraintSetFlags : 0
    [ 196.251] [m3video] videnc2Params->enableRCDO : 0
    [ 196.251] [m3video] videnc2Params->enableLongTermRefFrame : 0
    [ 196.251] [m3video] videnc2Params->LTRPPeriod : 0
    [ 196.252] [m3video] videnc2Params->numTemporalLayer : 1
    [ 196.252] [m3video] videnc2Params->referencePicMarking : 1
    [ 196.252] [m3video] videnc2Params->nalUnitControlParams.naluControlPreset :1
    [ 196.252] [m3video] videnc2Params->nalUnitControlParams.naluPresentMaskEndOfSequence :3072
    [ 196.252] [m3video] videnc2Params->nalUnitControlParams.naluPresentMaskIDRPicture :9184
    [ 196.252] [m3video] videnc2Params->nalUnitControlParams.naluPresentMaskIntraPicture :8962
    [ 196.252] [m3video] videnc2Params->nalUnitControlParams.naluPresentMaskNonIntraPicture :578
    [ 196.252] [m3video] videnc2Params->nalUnitControlParams.naluPresentMaskStartOfSequence :9120
    [ 196.252] [m3video] videnc2Params->vuiCodingParams.vuiCodingPreset :1
    [ 196.252] [m3video] videnc2Params->vuiCodingParams.hrdParamsPresentFlag :1
    [ 196.252] [m3video] videnc2Params->vuiCodingParams.timingInfoPresentFlag :1
    [ 196.252] [m3video] This Core is alive:49624


    Plz advise.
    thx ~

    HB
  • Hi HB,

    Can you let me know what is inBufs->dataLayout provided to codec??

    1 - Is it possible to change the GOP type after second field, then this issue may be observed.

    2 - Its upto the DVR-RDK to provide the required fields/frame. From codec prespective, if interlace coding type is selected then the provided fields will be encoded in TBTB order unless the inputcontent type changes to progressive. Codec cannot drop the filed based on any condition.
    Application should take care of this. Can you provide me the stream generated with all the top Fields.



    Regards
    Gajanan