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.

Simple TwoPass Encoding feature

Hi,

i am trying to use simple two pass encoding feature in recent h264 codec version.

i followed the example source code "H264encoderapp_stp.c"

i have created two codec instances1 for low resolution ( i am using for Face detection purpose in chain mode ) encode

and another instance for high resolution encode.

i made metaDataGenerateConsume =1 for low resolution and 2 for high resolution.

after encoding of low resolution (process call ) i made metaDataGenerateConsume =3.

then i am trying to copy the meta data from LR output buffer to High resolution input buffer as it is done in the example code.

but when i see the number of buffers for both the LR and HR encoder after XDM_GETBUFINFO

i have only 1 output buffers for each. so where the meta data information is ?

------------------

LR-videncStatus.bufInfo.minNumInBufs = 2
LR-videncStatus.bufInfo.minNumOutBufs = 1

HR-videncStatus.bufInfo.minNumInBufs = 3
HR-videncStatus.bufInfo.minNumOutBufs = 1

----------------

i think some where i am doing wrong. bcoz in the example source code meta data copy is happening in the following way in to outobj.bufs[1] or 2,3.

where as i have only 1 buffer.

 

if(dynamicparams[0].metaDataGenerateConsume == 3 )
    {
     if(dynamicparams[1].metaDataGenerateConsume == 2)
     {
      XDAS_Int32 *frameinfoPtr;
      XDAS_UInt32 loopcnt;
      frameinfoPtr = (XDAS_Int32 *)(outobj[0].bufs[1]);
      if (dynamicparams[0].sliceSize > 0 && !(params[0].entropyMode || !(params[0].encQuality)))
      {
       if(dynamicparams[0].mvSADoutFlag == 0)
        frameinfoPtr = (XDAS_Int32 *)(outobj[0].bufs[2]);
       else
        frameinfoPtr = (XDAS_Int32 *)(outobj[0].bufs[3]);
      }
      else
      {
       if(dynamicparams[0].mvSADoutFlag == 1)
        frameinfoPtr = (XDAS_Int32 *)(outobj[0].bufs[2]);
      }
      memcpy(inobj[1].bufDesc[2].buf,frameinfoPtr,sizeof(FrameInfo_Interface));

 

has any one used this feature ? i need some suggestion on how to do this.

  • Ideally it should work. I don't see any problem in your method. After your XDM_GETBUFINFO call you should see 2 output buffers for low resolution encoder.  Which codec version you are using? Could you share your testapp and configuration what you are using for both low and high resolution?

  • Dear Sujit Mahapatro

    I beg your pardon for interfeering. Could you probably help me? I assumed you delt with DM365IPNC-IMXO35

    I've got DM365IPNC-IMX035 12VG412ASIR

     The task is to put an inscription onto the screen/videopicture (PAL format) Is it possible?

    I have no DM365EVM

    Pleaeese answer!