Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set FPS in GIFs #2151

Open
TimSchneider42 opened this issue Apr 10, 2024 · 2 comments · May be fixed by #2152
Open

Unable to set FPS in GIFs #2151

TimSchneider42 opened this issue Apr 10, 2024 · 2 comments · May be fixed by #2152
Labels
bug Issues that report (apparent) bugs. lib-imageio Issues pertaining to dependency imageio. video Related to VideoClip and related classes, or handling of video in general.

Comments

@TimSchneider42
Copy link

TimSchneider42 commented Apr 10, 2024

Hey,

When using MoviePy to store frame sequences as GIFs, I noticed that setting the fps parameter seems to have no effect. After digging around in the code a little bit, I found the issue.

In moviepy/video/io/gif_writers.py, line 442:

writer = imageio.save(
    filename, duration=1.0 / fps, quantizer=quantizer, palettesize=colors, loop=loop
)

Here, the duration passed to imageio is in seconds, which is consistent with imageio's documentation. Unfortunately, though, the documentation is erroneous in this case, as the underlying Pillow expects milliseconds.

I believe the best course of action is to ignore the documentation of imageio and pass the value as milliseconds.

Currently, this issue affects PyTorch's SummaryWriter, which uses MoviePy to store videos as GIFs.

Best,
Tim

@TimSchneider42 TimSchneider42 added the bug Issues that report (apparent) bugs. label Apr 10, 2024
TimSchneider42 added a commit to TimSchneider42/moviepy that referenced this issue Apr 10, 2024
TimSchneider42 added a commit to TimSchneider42/moviepy that referenced this issue Apr 23, 2024
@keikoro keikoro added video Related to VideoClip and related classes, or handling of video in general. lib-imageio Issues pertaining to dependency imageio. labels May 24, 2024
@IcarusWizard
Copy link

I would also appreciate the bug being fixed; having tensorboard logging at the wrong fps is really annoying.

@TimSchneider42
Copy link
Author

I agree! @keikoro, can I help you with anything to get this pull request merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that report (apparent) bugs. lib-imageio Issues pertaining to dependency imageio. video Related to VideoClip and related classes, or handling of video in general.
Projects
None yet
3 participants