zhangyong 1 yıl önce
ebeveyn
işleme
e0e7721580
2 değiştirilmiş dosya ile 1 ekleme ve 11 silme
  1. 1 1
      main.py
  2. 0 10
      video_stitching/video_stitching.py

+ 1 - 1
main.py

@@ -18,7 +18,7 @@ def job_douyin_data():
 schedule.every().day.at("14:00").do(job_douyin_data)
 
 # 设置上午4点运行任务
-schedule.every().day.at("12:45").do(job_video_stitching)
+schedule.every().day.at("13:20").do(job_video_stitching)
 
 while True:
     schedule.run_pending()

+ 0 - 10
video_stitching/video_stitching.py

@@ -123,13 +123,6 @@ class VideoStitching():
         else:
             return False
 
-    def get_io_bps(cls):
-        io_counters = psutil.Process().io_counters()
-        read_bps = io_counters.read_bytes / 5  # 每秒读取的字节数
-        write_bps = io_counters.write_bytes / 5  # 每秒写入的字节数
-        Common.logger().info(f"当前读取速度:{read_bps} B/s")
-        Common.logger().info(f"当前写入速度:{write_bps} B/s")
-
 
     # 视频拼接
     @classmethod
@@ -191,7 +184,6 @@ class VideoStitching():
         Common.logger().info(f"处理SRT字幕文件")
         if os.path.isfile(subtitle_file):
             with open(subtitle_file, 'r') as file:
-                cls.get_io_bps()
                 subtitles = file.read().strip().split('\n\n')
             # 从SRT字幕文件中获取字幕
             subtitle_clips = []
@@ -226,9 +218,7 @@ class VideoStitching():
             )
             # 把 `文本剪贴板` 贴在视频上
             video_with_subtitles = editor.CompositeVideoClip([final_clip, text_clip])
-
         # 生成视频
-        cls.get_io_bps()
         video_with_subtitles.write_videofile(output_path, codec='libx264', fps=24)
         if os.path.isfile(output_path):
             Common.logger().info("视频生成成功!生成路径为:", output_path)