How can I configure PyNvVideoCodec to prevent screen artifacts or corrupted frames (e.g., visual glitches) during RTSP stream decoding?

The same RTSP stream does not exhibit these issues when decoded using OpenCV. What might be the root cause, and how can it be resolved?