Permuted frame order when encoding pytorch frames

when encoding pytorch generated frames with PyNvVideoCodec, frame order is incorrect. 1.0.2 works fine but 2.0.0, 2.0.1 and 2.0.2 won’t work correctly

to replicate:

construct a pytorch tensor sequence in yuv420 named images

for i in range (N):

input_tensor = images[i,:,:,:]

torch.cuda.synchronize()

bitstream = self.encoder.Encode(input_tensor)

bitstream = bytearray(bitstream)

Will observe that encoded video have permuted (stuttering) frame. The permuting window is around 32 frames

NVIDIA-SMI 570.86.10 Driver Version: 570.86.10 CUDA Version: 12.8

GPU: 5090
Codec used: hevc

Hi @jwzhang191
Could you please share input and minimal repro script?