Update app.py
Browse files
app.py
CHANGED
@@ -40,6 +40,8 @@ from moviepy.video.VideoClip import ColorClip
|
|
40 |
import time
|
41 |
from concurrent.futures import ThreadPoolExecutor
|
42 |
|
|
|
|
|
43 |
# 환경 변수 설정으로 torch.load 체크 우회 (임시 해결책)
|
44 |
os.environ["TRANSFORMERS_ALLOW_UNSAFE_DESERIALIZATION"] = "1"
|
45 |
|
@@ -658,13 +660,17 @@ def merge_videos_with_audio(video_files, audio_file, audio_volume, output_fps):
|
|
658 |
adjusted_clips = []
|
659 |
for i, clip in enumerate(video_clips):
|
660 |
if clip_sizes[i] != (target_width, target_height):
|
661 |
-
#
|
662 |
-
adjusted_clip = clip.
|
|
|
|
|
|
|
663 |
adjusted_clips.append(adjusted_clip)
|
664 |
else:
|
665 |
adjusted_clips.append(clip)
|
666 |
|
667 |
video_clips = adjusted_clips
|
|
|
668 |
|
669 |
# 첫 번째 비디오의 FPS를 기본값으로 사용
|
670 |
if output_fps == 0:
|
|
|
40 |
import time
|
41 |
from concurrent.futures import ThreadPoolExecutor
|
42 |
|
43 |
+
from moviepy.video.fx import resize as vfx_resize
|
44 |
+
|
45 |
# 환경 변수 설정으로 torch.load 체크 우회 (임시 해결책)
|
46 |
os.environ["TRANSFORMERS_ALLOW_UNSAFE_DESERIALIZATION"] = "1"
|
47 |
|
|
|
660 |
adjusted_clips = []
|
661 |
for i, clip in enumerate(video_clips):
|
662 |
if clip_sizes[i] != (target_width, target_height):
|
663 |
+
# vfx.resize 사용
|
664 |
+
adjusted_clip = clip.fx(
|
665 |
+
vfx_resize,
|
666 |
+
newsize=(target_width, target_height)
|
667 |
+
)
|
668 |
adjusted_clips.append(adjusted_clip)
|
669 |
else:
|
670 |
adjusted_clips.append(clip)
|
671 |
|
672 |
video_clips = adjusted_clips
|
673 |
+
|
674 |
|
675 |
# 첫 번째 비디오의 FPS를 기본값으로 사용
|
676 |
if output_fps == 0:
|