it happens at assert(index != len(self.df.index)) when index = 4297 which is also the length of self.df.index.
but to more exact, the error happens at buffer=self.load_frames(self.fnames[index]). I added the assertion to track it with pdb