zhangyong 1 rok temu
rodzic
commit
1f84a43a63
1 zmienionych plików z 3 dodań i 5 usunięć
  1. 3 5
      video_agc/agc_video_method.py

+ 3 - 5
video_agc/agc_video_method.py

@@ -178,8 +178,6 @@ class AgcVidoe():
         # 遍历并删除所有 .mp4 文件
         for mp4_file in mp4_files:
             os.remove(mp4_file)
-            print(f"已删除文件: {mp4_file}")
-
         print(f"文件夹 '{folder_path}' 中的所有 .mp4 文件已清空。")
 
     # 计算需要拼接的视频
@@ -312,7 +310,7 @@ class AgcVidoe():
         # 背景色参数
         background_cmd = "drawbox=y=ih-65:color=yellow@1.0:width=iw:height=0:t=fill"
         # 多线程数
-        num_threads = 8
+        num_threads = 4
         # 构建 FFmpeg 命令,生成视频
         ffmpeg_cmd_oss = [
             "ffmpeg",
@@ -329,9 +327,9 @@ class AgcVidoe():
             v_oss_path
         ]
         try:
-            subprocess.run(ffmpeg_cmd, check=True)
+            subprocess.run(ffmpeg_cmd)
             if os.path.isfile(v_path):
-                subprocess.run(ffmpeg_cmd_oss, check=True)
+                subprocess.run(ffmpeg_cmd_oss)
             print("视频处理完成!")
         except subprocess.CalledProcessError as e:
             print(f"视频处理失败:{e}")