openfree commited on
Commit
7a73858
·
verified ·
1 Parent(s): 8b56e06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -40,7 +40,7 @@ from moviepy.video.VideoClip import ColorClip
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"
@@ -657,20 +657,19 @@ def merge_videos_with_audio(video_files, audio_file, audio_volume, output_fps):
657
  logging.warning(f"비디오 크기가 서로 다릅니다. 첫 번째 비디오 크기({target_width}x{target_height})로 조정합니다.")
658
 
659
  # 크기가 다른 비디오들을 조정
 
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:
 
40
  import time
41
  from concurrent.futures import ThreadPoolExecutor
42
 
43
+ from moviepy.editor import VideoFileClip, concatenate_videoclips
44
 
45
  # 환경 변수 설정으로 torch.load 체크 우회 (임시 해결책)
46
  os.environ["TRANSFORMERS_ALLOW_UNSAFE_DESERIALIZATION"] = "1"
 
657
  logging.warning(f"비디오 크기가 서로 다릅니다. 첫 번째 비디오 크기({target_width}x{target_height})로 조정합니다.")
658
 
659
  # 크기가 다른 비디오들을 조정
660
+
661
  adjusted_clips = []
662
  for i, clip in enumerate(video_clips):
663
  if clip_sizes[i] != (target_width, target_height):
664
+ # VideoClip 자체의 resize() 메서드 사용
665
+ adjusted_clip = clip.resize((target_width, target_height))
 
 
 
666
  adjusted_clips.append(adjusted_clip)
667
  else:
668
  adjusted_clips.append(clip)
669
 
670
  video_clips = adjusted_clips
671
+
672
+
673
 
674
  # 첫 번째 비디오의 FPS를 기본값으로 사용
675
  if output_fps == 0: