Unexpected frame order with NVDEC while forcing zero latency

Hey everyone,

I’ve been dabbling with the NVDecoder sample from NVIDIA’s Video Codec SDK 12.1 on my RTX 4080 (Driver version 535.154.05, Ubuntu 22.04). My setup includes bLowLatency and force_zero_latency = true, alongside the CUVID_PKT_ENDOFPICTURE flag. Despite feeding the decoder sequential frames (like 1,2,3…) and accurate timestamps, my output gets all mixed up (ends up like 1,2,3,4,5,3,4,5,6,7…) when zero latency is in play. Forcing zero latency causes the handlePictureDecode handler to ignore the timestamps, but I still can’t understand the reason behind the repeated and odd order while getting decoded frames. I fixed my problem by making some changes in my code and switching force_zero_latency off while keeping the timestamps. I’m feeding it only I and P frames(not a single B-frame at all), using cudaVideoCodec_H264.

I am curious what causes this behaviour . Got any ideas why this happens? Let me know if you need any code snippets to get a better picture of the issue.