Some changes

This commit is contained in:
2024-02-29 16:51:40 +01:00
parent 5e7b32dc7a
commit be3776e1ce
5 changed files with 76 additions and 24 deletions

View File

@@ -49,15 +49,15 @@ class VideoBackgroundEngine(BaseBackgroundEngine):
clip = background.subclip(start, start + self.ctx.duration)
w, h = clip.size
self.ctx.credits += f"\n{self.background_video.data['credits']}"
self.ctx.index_0.append(
crop(
clip,
width=self.ctx.width,
height=self.ctx.height,
x_center=w / 2,
y_center=h / 2,
)
)
if w == h:
clip = clip.resize(width=self.ctx.width) if w > h else clip.resize(height=self.ctx.height)
elif w > h:
clip = clip.resize(width=self.ctx.width)
clip = crop(clip, width=self.ctx.width, height=self.ctx.height, x_center=w / 2, y_center=h / 2)
else:
clip = clip.resize(height=self.ctx.height)
clip = crop(clip, width=self.ctx.width, height=self.ctx.height, x_center=w / 2, y_center=h / 2)
self.ctx.index_0.append(clip)
@classmethod
def get_settings(cls):