-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Problems with complex mask #70
Comments
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 ;) ? |
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 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. |
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. |
Thanks, I'll dig around a bit |
I'm trying to cut out some areas with mask, shift them in time, mix together and finally put on background, but there are blend artifacts — accuracy loss or something.
There are no artifacts with "binary" mask:
mask_mf = lambda t: gif_mask.reader.get_frame(t)[:,:,0]/255
The text was updated successfully, but these errors were encountered: