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.

DM8148 encoded frame buffer flags



Hi,

In the IL_ClientOutputBitStreamWriteTask() thread when I print the nflags of the buffer which is read out from the opBufPipe[0] the nflags is always set to zero.

I want to know when I can get OMX_BUFFERFLAG_ENDOFFRAME/OMX_BUFFERFLAG_SYNCFRAME flags set.

And also reading from the output pipe buffer the size of the buffers read is different always, in the IL_ClientOutputBitStreamWriteTask() thread In each read do we read entire frame ? How can we determine whether its a I/P/B frame ?

I want to skip first few frames of the encoded video and then later write to the file for which I need to determine the above.

Any quick pointer might be helpful!

Thanks And Regards,

MIke

 

  • Hello,

    mike A said:
    I want to know when I can get OMX_BUFFERFLAG_ENDOFFRAME/OMX_BUFFERFLAG_SYNCFRAME flags set.

    What is the software release that you are using here ?

    What is the hardware platform?

    Best Regards,

    Margarita

  • Hi,

    my platform is DM8148 evm from mistral, and my software release is ezsdk.


    Thanks & Regards,

    Mike

  • Hello,

    I will check and I will let you know.

    Best Regards,

    Margarita

  • Hi Margarita,

    Thank you! waiting for your response.

    Thank  & Regards

    Mike

  • Hi,

    Also wanted to know, in the IL_ClientOutputBitStreamWriteTask() thread when the buffer is read is the buffer one complete encoded frame ? I ask because when I print filledlen it varies (I expect it to non varying If I am wrong as I have set the INTRA_FRAME_INTERVAL as 1 and no B frames.

    Thanks & Regards,

    Mike

  • Hi Mike,

    VENC component will set the buffer flags OMX_BUFFERFLAG_ENDOFFRAME and OMX_BUFFERFLAG_SYNCFRAME. 

    Every FillBufferDone from encoder component callback returns one complete encoded compressed frame. The size of frame varies since it depends on the contents of video encoded.

    From your intraFrameInterval settings you will come to know if the frame received in I frame or P frame.

    Thanks

    Ram

     

  • Hi Mike,

    Correction:

    VENC component will not set the buffer flags OMX_BUFFERFLAG_ENDOFFRAME and OMX_BUFFERFLAG_SYNCFRAME

  • Hi,

    So how do I get this (OMX_BUFFERFLAG_ENDOFFRAME/OMX_BUFFERFLAG_SYNCFRAME) flags set ?

    Also is the pBufferOut->nTimeStamp is the actaul timestamp when buffer was captured by the bridge or is it the time at which the frame was encoded ?

    Thanks And Regards,

    Mike

  • Hi Mike,

    Since every FillBufferDone call from encoder exactly outputs one complete frame setting OMX_BUFFERFLAG_ENDOFFRAME is not required.

    OMX_BUFFERFLAG_SYNCFRAME can be set for I/IDR type of frames which is not done now.

    Do you have access to OMX source code?

    encoder component copies nTtimeStamp from inputbuffer to outputbuffer header. So whatever your iLclient sets nTimeStamp( or capture component's nTimeStamp) will  be copied to encoder's output buffer.

    Ram

  • Hi Mike,

    If you have OMX overlay package available with you, you can modify omx_venc.c to get these two flags as shown below.

    In OMX_TI_VIDENC_CB_ProcessDone(), before sending the outputBuffer, set these flags.

    if(pArgsPtr->freeBufID[0]) {

    if (pArgsPtr->bytesGenerated) {

    pOutBufHeader->nFlags |= OMX_BUFFERFLAG_ENDOFFRAME;
    if(pArgsPtr->encodedFrameType == IVIDEO_I_FRAME || pArgsPtr->encodedFrameType == IVIDEO_IDR_FRAME)
           pOutBufHeader->nFlags |= OMX_BUFFERFLAG_SYNCFRAME;

    For every output buffer sent, now you should be able to see OMX_BUFFERFLAG_ENDOFFRAME setting, since every frame has complete frame. and for I / IDR type of frames, nFlags will have OMX_BUFFERFLAG_SYNCFRAME settings.

    Thanks

    Ram