From a43b47c0b8f01f2145e317eddd7c23a3fa13f6d4 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Tue, 29 Mar 2022 16:56:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A5KeyFrame=E5=88=87=E5=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quick_split_video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quick_split_video.py b/quick_split_video.py index a82650e..38237d0 100644 --- a/quick_split_video.py +++ b/quick_split_video.py @@ -11,7 +11,7 @@ OVERFLOW_SEC = 4 def get_video_real_duration(filename): ffmpeg_process = subprocess.Popen([ - "ffmpeg", "-i", filename, "-c", "copy", "-f", "null", "-" + "ffmpeg", "-hide_banner", "-i", filename, "-c", "copy", "-f", "null", "-" ], stdout=subprocess.PIPE, stderr=subprocess.PIPE) result = "0:0:0.0" for line in ffmpeg_process.stderr.readlines(): @@ -44,9 +44,9 @@ if __name__ == '__main__': print("BIAS_T", current_sec) split_process = subprocess.Popen([ "ffmpeg", "-y", "-hide_banner", "-progress", "-", "-v", "0", + "-ss", str(current_sec), "-i", input_file, "-c", "copy", "-f", "mp4", "-t", str(EACH_SEC + OVERFLOW_SEC), - "-ss", str(current_sec), "{}.mp4".format(current_dt) ]) split_process.wait()