NVdec error handling with multi slice frames

Hello

I am working on application that receives h.265 stream over cellular link and decodes it for immediate display. The h.265 stream in question has bandwidth around 2Mbit/s, 30FPS and there is slice size limit at around 1kB. In effect, most of the frames consist of many slices (7-10 I’d say). Usually I get complete frames, and so I feed all the slices from the frame to the CUVID decode via Nvidia’s parser. So far so good.

But every now and then, the cellular connection drops something. Usually this is just a single slice loss. So say I receive 9 out of 10 slices, I still prepare the input for the parser, set appropriate flags (including setting correctly CUVID_PKT_ENDOFPICTURE on the last slice fed) and start the decoding.

What I get is decoded frame marked with “decode error” flag (correct) and obviously I get some artifacts in the stream later on. And rightly so - some information was lost and this is exactly what I expected.

But recently I started to look closely at the frame decoded with errors, I mean actual image of the said frame. And it turned out, this is simply PREVIOUS image, the one that was decoded correctly just before erroneous frame. My understanding is that upon receiving the incomplete slices for the frame decoders ends up rolling back all the decode work and simply returns previous contents of the image buffer.

To be honest this is kind of disappointing. As I said, my frames have several slices, but even if it is only one slice that is lost (say the very last one, which is not that important) there will be no effects of decoding those that have arrived and were fed correctly.

I would be grateful for answers for the following questions:

  1. Is this a standard behaviour or bug? h.265 slices are designed, apart from other reasons (fe to make writing parallel encoder easier) to assist error resilience. Each slice should be decodable on its own, it is independent from other slices (save from Inter prediction effects). I would expect the decoder to decode and display data from all properly delivered slices.

  2. Is there something I can do to control error-handling behaviour?

Best regards
Michal

Hello experts,
Checking in on the post above whether the nvdec error concealment can be configured? We observe that frames with missing NALs are dropped, and the previous frame is repeated. That occurs even if only a single NAL is missing. Are there any configuration options about this behavior, for example displaying all correctly decoded NALs in an updated frame with only the missing NAL(s) hidden/removed?
Thanks.

Tagging @mandar_godse – is there anyone you could refer us to who may be able to speak to the error concealment of nvdec, and possible configuration options?

1 Like