Skip to content

Commit

Permalink
Fix vertical video
Browse files Browse the repository at this point in the history
  • Loading branch information
radry authored Feb 8, 2024
1 parent 3439aef commit d320ca9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Backend/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ def combine_videos(video_paths: List[str], max_duration: int) -> str:

# Not all videos are same size,
# so we need to resize them
if not round((clip.w/clip.h), 4) == 0.5625:
if round((clip.w/clip.h), 4) < 0.5625:
clip = crop(clip, width=clip.w, height=round(clip.w/0.5625), \
x_center=clip.w / 2, \
y_center=clip.h / 2)
else:
clip = crop(clip, width=round(0.5625*clip.h), height=clip.h, \
x_center=clip.w / 2, \
y_center=clip.h / 2)
Expand Down

0 comments on commit d320ca9

Please sign in to comment.