Skip to content

End of video sometimes(?) cut off when appending PNG data to ffmpeg writer #304

Closed

Description

@tnjd

Code to reproduce:

with imageio.get_writer(location, format='ffmpeg', mode='I', codec= fps=1000/duration, quality=6) as writer:
  for i in range(foo):
    writer.append_data(imageio.imread(some_data, 'png'))

or also replacing the context manager with imageio.get_writer(location, format='mp4', mode='I', fps=1000/duration, quality=6)

The result is that what should be a perfect loop has a noticeable skip, which I believe is caused by the end of the video being skipped over.

You can see what i mean by looping https://0x0.st/sbJq.mp4 and https://0x0.st/sbJN.gif . The gif is a perfect loop, whereas the mp4 is not.

Activity

  1. almarklein commented on Mar 12, 2018

    @almarklein
    Member

    I am not sure if this can be attributed to imageio. FFMPEG encodes using keyframes and my feeling is that the end not being aligned with a keyframe causes an "inaccurate" ending. But I'd love to be proven wrong on this. Maybe @kuchi ?

  2. almarklein commented on Feb 5, 2019

    @almarklein
    Member

    This could either be what I mentioned in the above post, or the estimate of the number of frames could be 1 frame short, which was not uncommon. The latter will be fixed wirth #425.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions