1- from moviepy .editor import VideoFileClip
2- from moviepy .video .fx .all import resize , crop
1+ from moviepy .video .io .VideoFileClip import VideoFileClip
32import selenium .webdriver .edge .options
43from PyQt5 import QtCore , QtGui , QtWidgets
54from PyQt5 .QtGui import *
@@ -753,7 +752,7 @@ def split_video_to_gifs(self):
753752 self .progressBar .setValue (40 )
754753 self .label_progress .setText (f"正在裁剪時間段: { self .start_time } -{ self .finish_time } 秒..." )
755754 QtWidgets .QApplication .processEvents ()
756- video = video .subclip (self .start_time , self .finish_time )
755+ video = video .subclipped (self .start_time , self .finish_time )
757756 if video is None :
758757 self .progressBar .setVisible (False )
759758 self .label_progress .setVisible (False )
@@ -765,7 +764,7 @@ def split_video_to_gifs(self):
765764 self .progressBar .setValue (50 )
766765 self .label_progress .setText ("正在調整影片尺寸..." )
767766 QtWidgets .QApplication .processEvents ()
768- video = resize ( video , (770 ,449 ))
767+ video = video . resized ( (770 ,449 ))
769768 if video is None :
770769 self .progressBar .setVisible (False )
771770 self .label_progress .setVisible (False )
@@ -833,7 +832,7 @@ def split_video_to_gifs(self):
833832 continue
834833
835834 # 執行裁剪操作
836- gif_segment = crop ( video , x1 = start_x , x2 = end_x , y1 = 0 , y2 = height )
835+ gif_segment = video . cropped ( x1 = start_x , x2 = end_x , y1 = 0 , y2 = height )
837836
838837 # 詳細檢查裁剪結果
839838 if gif_segment is None :
0 commit comments