Hi,
I know (I’ve digged into the torchvision code but not in pyav’s).
It seems all the libraries use ffmpeg as backend. That’s why my insight is it is related to stamps or the way libraries stop decoding. I realized that the frame counter of the library which properly extract the frames count the same frames than the ones which are wrong. So I think other libraries internally stop decoding once they reach that “last” frame.
Anyway thanks for having a look