ITADN

duplicated first frame and missing last frame

#167Opennuclearpolygon 创建于 2024-08-20
N
nuclearpolygoncommented
Hi, @matham! I encountered strange issue, I want to populate a list with frames using the following code ``` def __init_player(self): self.frame_list = [] val = '' nf = 0 while val != 'eof': frame, val = self.player.get_frame() if val != 'eof' and frame is not None: img, t = frame data = img.to_bytearray()[0] width, height = img.get_size() image = QImage(data, width, height, QImage.Format_RGB888) self.frame_list.append(QPixmap.fromImage(image)) # I use the next code to ensure the issue really happens on this stage image.save(f'~/img/{nf}.jpg') nf += 1 ``` This works well, despite the fact that the first frame is read twise while the last is missing. maybe I'm missing something... the usage looks so simple so I really have no clue what could went wrong! btw does the library depend on system ffmpeg? maybe some other version has no such problem? ffpyplayer 4.5.1 is what I'm using for now Any advice is appreciated! Thanks!
1 条评论