Comments (5)
The gif writing is slow because ImageMagick is slow. If you want something much faster, you can use ffmpeg by using clip.write_gif("myanimation.gif", program="ffmpeg")
, your gif will be even bigger in size, but it will be generated very fast, so it's useful for previewing, and when you are happy with the result you remove program="ffmpeg" and it will generate the gif with ImageMagick.
If you want a smaller size, use ImageMagick, but then it's more an art than a science, here is what you can do: (1) reduce the fps. Movies can have up to 30fps which is way too much for a gif. Try clip.write_gif('test.gif', fps=15)
. (2) use the opt
option. It can be opt=OptimizePlus or opt=OptimizeTransparency. It will tell ImageMagick to reduce the size of the GIF using some compression methods. (3) if you have a clip with very few colors, provide colors=3
. Note that for many colors like colors=256
the algorithm can be superslow.
from moviepy.
thanks very much... sorry for me being lazy didn't read the write_gif documentation..
where do i put the color parameter though?
from moviepy.
in write_gif. I am closing the issue (as it seems to be solved) but if you have more questions you can still ask them in this thread.
from moviepy.
it gives me error if I put it in write_gif, reading the documentation there is no color parameter too
from moviepy.
Strange. But this parameter is only here since the very last version (on github). Forget about it for now, it's not tested anyway.
from moviepy.
Related Issues (20)
- No sound HOT 2
- how to keep the aspect ratio for my vertical video? HOT 5
- I cut 1800 seconds of audio, but the result is 1846 seconds. Why is this happening? How can I solve this problem?
- Resizable rounded rectangle
- Getting `AttributeError: 'NoneType' object has no attribute 'get_frame'` when trying to save a `CompositeVideoClip`
- Error When Generating a Long video and not getting the error when generating a shorter video HOT 1
- AttributeError: 'NoneType' object has no attribute 'get_frame' when calling write_videofile HOT 1
- Vertical MOV video to MP4 HOT 3
- yielding write_videofile progress HOT 5
- Output video without sound
- Inconsistent video duration before and after write_videofile HOT 1
- Audio glitching when concatenating with moviepy
- Error Using MoviePy in Django Project on Linux (Python 3.12, MoviePy 1.0.3)
- Adapt to setuptools v72 HOT 4
- How to obtain an AudioArrayClip or AudioFileClip object from a MP3 BytesIO object?
- CompositeAudioClip not compute duration
- Documentation in a PDF or any other downloadable format please?
- Incorrect Rendering of Bengali Ligatures in Subtitles Using MoviePy HOT 2
- How to set opacity in text_clip using Lambda HOT 1
- Moviepy unable to concatenate a long list of videos but is able to concatenate a short list of videos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moviepy.