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.

Does VENC run on DM816x support multi-channel encode?

Hi,

I'm evaluating EVM 816x now. From datasheet, we know there are three HDVICP cores. And we invoke these cores with VENC( OMX.TI.DUCATI.VIDENC ) in EZSDK.

I tried to initialize three VENC OMX handles, through OMX_GetHandle(). It works first time, but the second and third one failed. So I guess I can only have one OMX handle.

And as mentioned in OMX user guide, VENC only have one input and one output port. I checked this point, actually. It fails when I use any other port than port 0 as input port.

MY QUESTION IS: Does VENC run on DM816x support multi-channel encode? If we can only have one OMX handle at one time, and only port 0 can be used as input port, is it true we can't have three HDVICP cores work simultaneity by calling OpenMAX?

Any help is highly appreciated! Thank u!

  • Hi,

    VENC supports multi-channel encode. Can you share details about the failure? You can also share the firmware traces obtained through loggerSMDump utility. See http://processors.wiki.ti.com/index.php/OMX_Viewing_Media_Controller_Traces on how to use this utility. If you are using a previous version of SDK (5.02), then loggerSMDump should be used without the <size> parameter as follows:

    ./loggerSMDump.out 0x9e400000 video

    Regards,

    Anirban

     

  • Hi Anirban,

    It looks like I mistakenly passed the wrong handle to OMX_GetHandle() function second time. Now I can create a second handle.

    ANOTHER QUESTION: If I use two OMX_HANDLETYPE * pHandle, does it mean the two channels are working on two separate HDVICP? I'm working with 8168, it has three HDVICP cores.

  • Hi,

    The HDVICP allocation is internally managed by the OpenMax HDVICP firmware based on the type of codec (Encoder or Decoder) and the estimated HDVICP load. Therefore, opening 2 channels does not necessarily mean 2 different HDVICP cores will be used.

    Regards,

    Anirban

  • Hi Anirban,

    I guess at least it's possible to have two HDVICP work simultaneity, if one is overloaded?

  • Yes. That is right!

    Regards,

    Anirban

     

  • Hi Anirban,

    I'm glad to know that.

    You did help me a lot! Thank you!

  • Hi,

    have you managed to make the two-component encoder setup work?

    Could you specify how did you do that?

    As I understand from being unable to run two processes that use OMX simultaneously(getting assert in syslink for the second process being run), I have to create a second component within the same process and write similar threads as for the first one (data supplier, data writer, callbacks, etc.).

    I experimented with the EZSDK 5.03 encode example to get a second encoder component running: I can create and initialize both components successfully,

    set the encoding params for both components, set the state of both components to "Idle", allocate input buffers for the first encoder component,

    but  have some unknown issues with allocating buffers for the second component.

    The call of OMX_AllocateBuffer() for the second component fails with the "OMX_ErrorBadParameter" error.

    The code that fails is:

     for (i = 0; i < pAppData->encILComp1->inPortParams->nBufferCountActual; i++)
      {

        eError = OMX_AllocateBuffer (pAppData->pEncHandle1,
                                &pAppData->encILComp1->inPortParams->pInBuff[i],
                                OMX_VIDENC_INPUT_PORT,
                                pAppData,
                                pAppData->encILComp1->inPortParams->nBufferSize);

        if (eError != OMX_ErrorNone)
        {
          printf ("Error in encode OMX_AllocateBuffer(): %s \n",
                  IL_ClientErrorToStr (eError));
          goto EXIT;
        }
      }
      printf (" encoder1 input port allocate buffer done \n ");

      for (i = 0; i < pAppData->encILComp2->inPortParams->nBufferCountActual; i++)
      {

        eError = OMX_AllocateBuffer (pAppData->pEncHandle2,
                                &pAppData->encILComp2->inPortParams->pInBuff[i],
                                OMX_VIDENC_INPUT_PORT,
                                pAppData,
                                pAppData->encILComp2->inPortParams->nBufferSize);

        if (eError != OMX_ErrorNone)
        {
          printf ("Error in encoder 2 OMX_AllocateBuffer(): %s \n",
                  IL_ClientErrorToStr (eError));
          goto EXIT;
        }
      }
      printf (" encoder 2 input port allocate buffer done \n ")
    ;

    pAppData->encILComp#->inPortParams->nBufferCountActual is set to "2" for both components via defines in ilclient_utils.h:

    #define IL_CLIENT_ENC_INPUT_BUFFER_COUNT         (2)

    #define IL_CLIENT_ENC_OUTPUT_BUFFER_COUNT     (2)

  • Hi,

    Sorry but I haven't gone as far as you did.

    I only managed to create two handles. And I haven't tried two processes neither.

    Currently I'm working on having two video streams simultaneously. Later, I maybe move to two encoders programming.

    So would you please kindly inform me if you achieve anything?

    Zhang

  • Sure, I'll share the results if it would be useful.

  • Hi,

    I've been trying to get multi-channel encode to work using OMX in EZSDK but haven't been succesful. I'm just wondering whether any of you have made any progress since last posting to this thread.

    I modified the encode example from EZSDK to make 2 encode components running simultaneously but it doesn't successfully encode the video. I have been able to create a handle for both components, setup all the parameters, allocate all the buffers, and move both components into the execute state. However, when I actually send video frames to the second handle, the EmptyBufferDone callback is executed but the FillBufferDone callback never gets called. The first encoder takes frames and encodes them just fine.

    If anyone has any idea what could be wrong, or has any working examples of multi-channel encoding that I could look at, it would be greatly appreciated.