zhangyong 1 year ago
parent
commit
c6efff0ef3
1 changed files with 7 additions and 1 deletions
  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():
 class VideoStitching():
     @classmethod
     @classmethod
     def split_text(cls, text, max_length):
     def split_text(cls, text, max_length):
@@ -124,6 +124,12 @@ class VideoStitching():
         total_duration = 0
         total_duration = 0
         included_videos = []
         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}")
         Common.logger().info(f"开始提取视频的音频{audio}")
         video1 = VideoFileClip(audio)
         video1 = VideoFileClip(audio)
         mp3 = video1.audio
         mp3 = video1.audio