openfree commited on
Commit
91627d2
Β·
verified Β·
1 Parent(s): 426f6e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -43,8 +43,12 @@ try:
43
  except ImportError:
44
  from moviepy import VideoFileClip, concatenate_videoclips
45
 
46
- # ✨ resize 효과 ν•¨μˆ˜λ§Œ 직접 μž„ν¬νŠΈ
47
- from moviepy.video.fx.resize import resize as vfx_resize
 
 
 
 
48
 
49
  from moviepy import (
50
  ImageSequenceClip,
@@ -60,6 +64,7 @@ import time
60
  from concurrent.futures import ThreadPoolExecutor
61
 
62
 
 
63
  # ── moviepy import ──────────────────────────────────────────
64
  # editor μ„œλΈŒλͺ¨λ“ˆμ΄ μžˆλŠ” 경우 μš°μ„  μ‚¬μš©, μ—†μœΌλ©΄ μ΅œμƒμœ„ moviepy μ‚¬μš©
65
  try:
@@ -700,11 +705,12 @@ def merge_videos_with_audio(video_files, audio_file, audio_volume, output_fps):
700
  logging.warning(f"λΉ„λ””μ˜€ 크기가 μ„œλ‘œ λ‹€λ¦…λ‹ˆλ‹€. 첫 번째 λΉ„λ””μ˜€ 크기({target_width}x{target_height})둜 μ‘°μ •ν•©λ‹ˆλ‹€.")
701
 
702
  # 크기가 λ‹€λ₯Έ λΉ„λ””μ˜€λ“€μ„ μ‘°μ •
 
703
  adjusted_clips = []
704
  for clip, size in zip(video_clips, clip_sizes):
705
  if size != (target_width, target_height):
706
- adjusted_clip = vfx_resize(clip, newsize=(target_width, target_height))
707
 
 
708
  adjusted_clips.append(adjusted_clip)
709
  else:
710
  adjusted_clips.append(clip)
 
43
  except ImportError:
44
  from moviepy import VideoFileClip, concatenate_videoclips
45
 
46
+ # resize ν•¨μˆ˜: 있으면 μ‚¬μš©, μ—†μœΌλ©΄ ν†΅κ³Όμš© λžŒλ‹€λ‘œ λŒ€μ²΄
47
+ try:
48
+ from moviepy.video.fx.resize import resize as vfx_resize
49
+ except ImportError:
50
+ def vfx_resize(clip, newsize):
51
+ return clip # resize 미지원 ν™˜κ²½ β†’ κ·ΈλŒ€λ‘œ λ°˜ν™˜
52
 
53
  from moviepy import (
54
  ImageSequenceClip,
 
64
  from concurrent.futures import ThreadPoolExecutor
65
 
66
 
67
+
68
  # ── moviepy import ──────────────────────────────────────────
69
  # editor μ„œλΈŒλͺ¨λ“ˆμ΄ μžˆλŠ” 경우 μš°μ„  μ‚¬μš©, μ—†μœΌλ©΄ μ΅œμƒμœ„ moviepy μ‚¬μš©
70
  try:
 
705
  logging.warning(f"λΉ„λ””μ˜€ 크기가 μ„œλ‘œ λ‹€λ¦…λ‹ˆλ‹€. 첫 번째 λΉ„λ””μ˜€ 크기({target_width}x{target_height})둜 μ‘°μ •ν•©λ‹ˆλ‹€.")
706
 
707
  # 크기가 λ‹€λ₯Έ λΉ„λ””μ˜€λ“€μ„ μ‘°μ •
708
+
709
  adjusted_clips = []
710
  for clip, size in zip(video_clips, clip_sizes):
711
  if size != (target_width, target_height):
 
712
 
713
+ adjusted_clip = resize(clip, newsize=(target_width, target_height))
714
  adjusted_clips.append(adjusted_clip)
715
  else:
716
  adjusted_clips.append(clip)