Comments (4)
Thanks for the interesting issue. This is indeed puzzling, for the moment I can't understand if it's a bug (= MoviePy really not working as expected), a problem in your code, or maybe a problem with the gifs or how they are read. Have you used masks for other purposes yet ? Have you had any issue ? I have made complex things with masks before and never had any issue. I'll have a better look into it when I have time.
PS: is this for reddit/perfectloops or something like this ;) ?
from moviepy.
I think I can confirm that your problem is a due to the combined facts that (1) the GIFs are somehow corrupted (some frames cannot be read by MoviePy) and (2) you are making copies of clips which all refer to the same video reader.
I'll try to explain: a videofileclip in moviepy has a "reader" which is like a pipe to the data on the hard drive. When you make a copy of the clip (for instance with clip2 = clip.set_start(t0)
) the reader is not copied (because it takes lots of place in the memory), the reader will be shared by clip
and its derivative clip2
. Now, if clip
asks the reader for a frame at some time t
and the reader cannot read it (because the file is somehow corrupted like in your example), the reader will instead give the last frame read. Normally this is the frame just before t
and the reading error is barely noticeable (the video staggers a little as it has two identical frames in a row). But if two clips are using the same reader, the last frame read can also be a frame anywhere else in the video.
This is what happens in your example: the reader can't read a frame and instead it gives the last frame read, which has actually been read by another clip, at a completely different time. So the clip and the masks are out of sync and strange stuff happens.
from moviepy.
I don't want to spoil the fun, but here is a version that works :D. It only needs the source, not the mask gif. See the result here.
https://gist.github.com/Zulko/9e65c119b9c9ad027608
from moviepy.
Thanks, I'll dig around a bit
from moviepy.
Related Issues (20)
- Release 0.2.4.0 missing
- video.preview() has a bug after concatenate_videoclips in version 1.0.3
- TypeError: '<' not supported between instances of 'str' and 'int' HOT 1
- Audio out of sync for combined DASH video
- Inconsistent duration for composite output HOT 1
- Trying to hide the Logger Bar in the console
- Text For Stroke/Outline Doesn't Align properly
- Unable to set FPS in GIFs
- Can I run 'write_videofile' function with GPU ? HOT 2
- I have a doubt, as shown in the picture, I get a 403 from my program, but from the browser it works!
- Saving the same video clip twice will yield different results
- Decorator not working correctly fps remains to be None and cause TypeError
- Sound doubling / looping when merging clips. HOT 1
- ffmpeg interpets video title as a command line argument when it begins with "-"
- Audio out of sync when I grab window bar.
- Bug in CompositeVideoClip
- Efficiency Disparity Between MoviePy and FFmpeg
- A household appliances company in the Netherlands and all of Europe, King Import Export, announces the theft of a container of household appliances and warns customers to beware of purchasing the product without invoices. The invoice must bear the company seal, King Import Export, so as not to be exposed to problems.
- ImageMagick Binary Not Found HOT 3
- King1
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.