AnsweredAssumed Answered

H264 MP Encoder Rel 3.0.0 - timestamps

Question asked by manliustech on Dec 4, 2012
Latest reply on Dec 6, 2012 by manliustech

Hello,

     we are using H264 Encoder library version 3.0.0 for video streaming. We need to embed in each frame the timestamp of when it was captured and for that we initialized the ADICodecConfigTimingInfo structure and sent to encoder using pSetConfig:

 

            gtTimingInfo.iTimingInfoPresentFlag = 1;

            gtTimingInfo.iPicTimingStructPresentFlag = 0;

            gtTimingInfo.nTimeScale=537500000/1024;

            gtTimingInfo.nNumUnitsInTick=(537500000/1024)/8;

            gtTimingInfo.iFixedFrameRateFlag=0;

            iRetVal = pEncHndl->pSetConfig(pEncHndl, ADI_CODEC_CONFIG_TIMING_INFO, (void*)&gtTimingInfo);

            if(iRetVal != ADI_CODEC_STATUS_OK)

.....

 

537500000 is the CPU clock, so when a frame is captured, we use Clock()/1024 to save frame timestamp in ulTS variable.

 

The above initialization works (iRetVal=ADI_CODEC_STATUS_OK) so later when a frame is being encoded, we set:

 


gtInMetaData.uiTimeStamp=ulTS;


   gtOutData.pData=bitstream;

iRetVal=stream->H264Vid->pProcess(stream->H264Vid,&gtInData,(void*)&gtInMetaData,&gtOutData,&pn[index]);

 

 

Everything works, apart that when we use FFMPEG to extract frame timing info (using av_frame_get_best_effort_timestamp(pFrame);) it tells that no timing info inside that frame.

 

We also tryed             gtTimingInfo.iTimingInfoPresentFlag = 0; as would be explained in developer guide to enable such info but no changes.

Is there anything else to know?

We read that the other timing info structure set with ADI_CODEC_CONFIG_PIC_TIMING_SEI is not yet implemented in this release...

 

Thank you in advance for any help

Best Regards

Manlio

 

(p.s. is any other new release of the library programmed?)

Outcomes