Update app.py
Browse files
app.py
CHANGED
@@ -43,8 +43,12 @@ try:
|
|
43 |
except ImportError:
|
44 |
from moviepy import VideoFileClip, concatenate_videoclips
|
45 |
|
46 |
-
#
|
47 |
-
|
|
|
|
|
|
|
|
|
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)
|