Skip to content

duplicated first frame and missing last frame #167

Description

@nuclearpolygon

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions