crossfadeout not effect after CompositeVideoClip
from moviepy import *
concat_video_clip = CompositeVideoClip([clip1, clip2], size=(video_width, video_height))
concat_video_clip = concat_video_clip.crossfadeout(magic_time)
Expected Behavior
crossfadeout can effect on clip for concat_video_clip
Actual Behavior
crossfadeout not effect on clip for concat_video_clip
Steps to Reproduce the Problem
Specifications
- Python Version: 3.10
- MoviePy Version: 2.0.0.dev2( build for latest code for master branch)
- Platform Name: Ubuntu
- Platform Version: 22.04
Okay, I checked this. When written out, it does have a crossfadeout effect if it's followed by another clip. On its own (i.e. no clip following it), you're right in saying there is no effect. But that's not actually a bug.
If you check the documentation for fadeout, it has this comment
""" Makes the clip progressively fade to some color (black by default), over
durationseconds at the end of the clip. Can be used for masks too, where the final color must be a number between 0 and 1. For cross-fading (progressive appearance or disappearance of a clip over another clip, seecomposition.crossfade"""
Source: https://zulko.github.io/moviepy/_modules/moviepy/video/fx/fadeout.html#fadeout
Basically, cross-fading is only for progressive appearance or disappearance of a clip OVER ANOTHER. The function that you are actually looking for is fadeout if there is no clip to follow.
I tried to use your variable names. Here is how to use fadeout
#https://github.com/Zulko/moviepy/issues/2138
from moviepy.editor import *
(video_width, video_height) = (1080,1920)
clip1 = TextClip("Hello",fontsize=100,size=(video_width, video_height),bg_color="blue",color="white").set_duration(1)
clip2 = TextClip("There",fontsize=100,size=(video_width, video_height),bg_color="blue",color="white").set_duration(1)
magic_time = 0.5
concat_clip = CompositeVideoClip([clip1,clip2.set_start(clip1.duration)])
concat_clip = concat_clip.fadeout(magic_time)
concat_clip.write_videofile("issue2138.mp4",fps=24)
Thank you for your contributions and for reporting issues in this repository. With the release of v2, which introduces significant changes to the codebase and API, we’ve reviewed the backlog of open PRs and issues. Due to the length of the backlog and the likelihood that many of these are either fixed or no longer applicable, we’ve made the decision to close all previous PRs and issues.
If you believe that any of these are still relevant to the current version or if you'd like to reopen a related discussion, please feel free to create a new issue or pull request, referencing the old one.
Thank you for your understanding and continued support!