فهرست منبع

增加字幕日志

zhangyong 1 سال پیش
والد
کامیت
7001912f36
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 2
      common/material.py
  2. 1 0
      video_stitching/video_stitching.py

+ 1 - 2
common/material.py

@@ -48,11 +48,10 @@ class Material():
         for row in audio[1:]:
             account_name = row[0]
             text = row[2]
-            if text == None:
-                print(1)
             number = {"audio_id": account_name,"text": text}
             list.append(number)
         list = random.choice(list)
+        print("随机获取音频+字幕为:"+list)
         audio_id = list['audio_id']
         srt = list['text']
         return audio_id, srt

+ 1 - 0
video_stitching/video_stitching.py

@@ -182,6 +182,7 @@ class VideoStitching():
         color_clip = editor.ColorClip(size=(final_width, 90),
                                       color=(255, 255, 0)).set_duration(duration_limit)
         final_clip = editor.CompositeVideoClip([final_clip, color_clip.set_position(("center", final_height - 70))])
+        Common.logger().info(f"字幕内容为:{srt}")
         if srt != None:
             Common.logger().info(f"处理字幕文件")
             # 使用正则表达式提取时间码和字幕内容