You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FedeSpu opened this issue
Nov 21, 2024
· 2 comments
Labels
bugIssues that report (apparent) bugs.v2.xIssues based on MoviePy version 2.0 and upwardsvideoRelated to VideoClip and related classes, or handling of video in general.
The error is in "ffmpeg_writer.py" file in line frame = np.dstack([frame, mask]). The problem is that the mask has shape [1,1]. This is due to concatenate_videoclips, that in line mask = clip.mask or ColorClip([1, 1], color=1, is_mask=True) produces mask of shape [1,1].
The solution that I've found is to replace this line with mask = clip.mask or ColorClip(clip.size, color=1, is_mask=True)
Specifications
Python Version: 3.12.2
MoviePy Version: 2.0.0
Platform Name: Ubuntu
Platform Version: 22.04
The text was updated successfully, but these errors were encountered:
I faced the same error and this solves it. Apparently, there is no reason to be [1, 1] shape in that situacion as it is fulfilling masks for clips without them when compositing. As FedeSpu says 👇
File: moviepy\video\compositing\CompositeVideoClip.py
Line 292, replace with this: mask = clip.mask or ColorClip(clip.size, color=1, is_mask=True)
Implosiv3
added a commit
to Implosiv3/moviepy
that referenced
this issue
Nov 27, 2024
Fixes the issue when concatenating videoclips as mask is being considered as [1, 1] so the mask shape is different from the other videos and fails.
I think [1, 1] could be a default mask to avoid divisions by zero or something similar, but here it does not make sense.
Issue here: Zulko#2247
keikoro
added
video
Related to VideoClip and related classes, or handling of video in general.
v2.x
Issues based on MoviePy version 2.0 and upwards
labels
Dec 8, 2024
bugIssues that report (apparent) bugs.v2.xIssues based on MoviePy version 2.0 and upwardsvideoRelated to VideoClip and related classes, or handling of video in general.
Expected Behavior
Export the video correctly after using concatenate_videoclips and write_videofile
Actual Behavior
ValueError, and the video is not produced
Steps to Reproduce the Problem
Solution
The error is in "ffmpeg_writer.py" file in line
frame = np.dstack([frame, mask])
. The problem is that the mask has shape [1,1]. This is due toconcatenate_videoclips
, that in linemask = clip.mask or ColorClip([1, 1], color=1, is_mask=True)
produces mask of shape [1,1].The solution that I've found is to replace this line with
mask = clip.mask or ColorClip(clip.size, color=1, is_mask=True)
Specifications
The text was updated successfully, but these errors were encountered: