From 8f0e69c3de02a385ea387a14e8e8f146f8fe13a1 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 24 Mar 2025 10:30:36 +0800 Subject: [PATCH] =?UTF-8?q?overall=5Fspeed=E7=89=87=E6=AE=B5=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=8F=98=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entity/ffmpeg.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/entity/ffmpeg.py b/entity/ffmpeg.py index d296647..678573b 100644 --- a/entity/ffmpeg.py +++ b/entity/ffmpeg.py @@ -220,6 +220,15 @@ class FfmpegTask(object): # filter_args.append(f"{_end_out_str}{_start_out_str}overlay=eof_action=pass{video_output_str}") filter_args.append(f"{_start_out_str}{_mid_out_str}{_end_out_str}concat=n=3:v=1:a=0,setpts=N/{self.frame_rate}/TB{video_output_str}") effect_index += 1 + elif effect.startswith("ospeed:"): + param = effect.split(":", 2)[1] + if param == '': + param = "1" + if param != "1": + # 视频变速 + effect_index += 1 + filter_args.append(f"{video_output_str}setpts={param}*PTS[v_eff{effect_index}]") + video_output_str = f"[v_eff{effect_index}]" elif effect.startswith("zoom:"): ... ...