zhangyong 1 年之前
父节点
当前提交
2fe0a46572
共有 1 个文件被更改,包括 9 次插入9 次删除
  1. 9 9
      video_agc/agc_video_method.py

+ 9 - 9
video_agc/agc_video_method.py

@@ -166,14 +166,14 @@ class AgcVidoe():
             return None
 
 
-    #  获取视频文件的时长(秒)
-    @classmethod
-    def get_video_duration(cls, video_file):
-        result = subprocess.run(
-            ["ffprobe", "-v", "error", "-show_entries", "format=duration",
-             "-of", "default=noprint_wrappers=1:nokey=1", video_file],
-            capture_output=True, text=True)
-        return float(result.stdout)
+    # #  获取视频文件的时长(秒)
+    # @classmethod
+    # def get_video_duration(cls, video_file):
+    #     result = subprocess.run(
+    #         ["ffprobe", "-v", "error", "-show_entries", "format=duration",
+    #          "-of", "default=noprint_wrappers=1:nokey=1", video_file],
+    #         capture_output=True, text=True)
+    #     return float(result.stdout)
 
     @classmethod
     def clear_mp4_files(cls, folder_path):
@@ -192,7 +192,7 @@ class AgcVidoe():
     @classmethod
     def concat_videos_with_subtitles(cls, videos, audio_duration, platform, mark):
         # 计算视频文件列表总时长
-        total_video_duration = sum(cls.get_video_duration(video_file[3]) for video_file in videos)
+        total_video_duration = sum(cls.get_audio_duration(video_file[3]) for video_file in videos)
         if platform == "koubo":
             # 视频时长大于音频时长
             if total_video_duration > audio_duration: