Skip to content

Commit

Permalink
Merge pull request FujiwaraChoki#46 from radry/Vertical-Video-handling
Browse files Browse the repository at this point in the history
Detect vertical video and don't crop
  • Loading branch information
FujiwaraChoki authored Feb 7, 2024
2 parents e3da6d6 + 77d239d commit 9dfce2e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Backend/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ def combine_videos(video_paths: List[str], max_duration: int) -> str:

# Not all videos are same size,
# so we need to resize them
clip = crop(clip, width=1080, height=1920, \
x_center=clip.w / 2, \
y_center=clip.h / 2)
if not clip.h > clip.w:
clip = crop(clip, width=1080, height=1920, \
x_center=clip.w / 2, \
y_center=clip.h / 2)
clip = clip.resize((1080, 1920))

clips.append(clip)
Expand Down

0 comments on commit 9dfce2e

Please sign in to comment.