OpenH264 concealing errors

278 Views Asked by At

I can't work out how to get error concealment working in OpenH264. My initialisation code looks like this:

SDecodingParam sDecParam = {0};
sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_SVC;
sDecParam.bParseOnly = false;
sDecParam.eEcActiveIdc = ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE;

if ( 0 == WelsCreateDecoder ( &decoder )  && decoder != nullptr && 0 == decoder->Initialize(&sDecParam) )

Obviously I've tried every possible option for concealment type, without much success

1

There are 1 best solutions below

0
On

Finally worked this out by stepping through the source of OpenH264:

  • in decoder setup set eEcActiveIdc to one of the concealment types (e.g. ERROR_CON_SLICE_MV_COPY_CROSS_IDR)
  • decode with DecodeFrame2 and NOT DecodeFrameNoDelay
  • Ignore the result code and only look at iBufferStatus in the info block, to see if a buffer is available.

Downside is that this introduces extra latency, so definitely not useful for all applications