zhangyong 1 年間 前
コミット
c6efff0ef3
1 ファイル変更7 行追加1 行削除
  1. 7 1
      video_stitching/video_stitching.py

+ 7 - 1
video_stitching/video_stitching.py

@@ -21,7 +21,7 @@ from moviepy import editor
 
 
 
-output_path = "./video_stitchingvideo/new_video.mp4"
+output_path = "./video_stitchingvideo/video/new_video.mp4"
 class VideoStitching():
     @classmethod
     def split_text(cls, text, max_length):
@@ -124,6 +124,12 @@ class VideoStitching():
         total_duration = 0
         included_videos = []
         # 提取视频的音频
+        filename = "./video_stitching/video.mp4"
+
+        response = requests.get(audio)
+        with open(filename, "wb") as f:
+            f.write(response.content)
+            time.sleep(10)
         Common.logger().info(f"开始提取视频的音频{audio}")
         video1 = VideoFileClip(audio)
         mp3 = video1.audio