-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[Misc] Improve gif output compression rate #6289
Conversation
✅ Deploy Preview for docsite-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
for more information, see https://pre-commit.ci
Thanks, will take a look next week! |
Many thanks for the PR - could you help benchmark the output size of the old ffmpeg approach against the new moviepy approach? |
for more information, see https://pre-commit.ci
The improvement in compression size is quite good. I used a 1.8MB size mp4 video to test the two methods:
@houkensjtu also has some insights on this comparison. |
FYI, I tested this PR using the taichi_dem repo. Previously, with the default frame rate and resolution, the gif generated by the first 100 frames output is around 45 MB. With this PR, the size is reduced to 32 MB. I guess the reason why the compression rate is not as good as @neozhaoliang 's result is that the frames from DEM are all black & white. The commands I used to generate the gif are as follows:
Overall, I think it's a good improvement over the ffmpeg method. We may include a comment in the doc to warn the users about the size of the generated gif, and point them to third-party compression tools (such as ezgif) if they wish so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you both! :-)
Issue: #6183