ffpyplayer
ffpyplayer copied to clipboard
duplicated first frame and missing last frame
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!
This seems to be possibly related to my issue since I see usage of pyqt