From f85ccea933569d1b0e96c5fb5b2ea6e96bf27123 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 18 Sep 2025 09:42:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(constant):=20=E6=9B=B4=E6=96=B0=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E7=89=88=E6=9C=AC=E5=8F=B7=E8=87=B3=200.0.6-=20?= =?UTF-8?q?=E5=9C=A8=20constant/=5F=5Finit=5F=5F.py=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E5=B0=86=20SOFTWARE=5FVERSION=20=E4=BB=8E=20'0.0.5'?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E4=B8=BA=20'0.0.6'=20-=20=E5=9C=A8=20enti?= =?UTF-8?q?ty/ffmpeg.py=20=E6=96=87=E4=BB=B6=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E6=96=B0=E7=9A=84=E8=A7=86=E9=A2=91=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=89=B9=E5=AE=9A=E6=97=B6=E9=95=BF=E7=9A=84?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=89=87=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- constant/__init__.py | 2 +- entity/ffmpeg.py | 9 +++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d65ddac..5a6bc28 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,5 @@ target/ .venv venv/ cython_debug/ -.env \ No newline at end of file +.env +.serena \ No newline at end of file diff --git a/constant/__init__.py b/constant/__init__.py index e9bfcca..16857d3 100644 --- a/constant/__init__.py +++ b/constant/__init__.py @@ -6,4 +6,4 @@ SUPPORT_FEATURE = ( 'rclone_upload', 'custom_re_encode', ) -SOFTWARE_VERSION = '0.0.5' +SOFTWARE_VERSION = '0.0.6' diff --git a/entity/ffmpeg.py b/entity/ffmpeg.py index 399e964..38ced9a 100644 --- a/entity/ffmpeg.py +++ b/entity/ffmpeg.py @@ -344,6 +344,15 @@ class FfmpegTask(object): filter_args.append(f"[v_rev{effect_index}]trim=duration={tail_seconds}[v_trim{effect_index}]") filter_args.append(f"[v_trim{effect_index}]reverse[v_eff{effect_index}]") video_output_str = f"[v_eff{effect_index}]" + elif effect.startswith("show:"): + param = effect.split(":", 2)[1] + if param == '': + param = "0" + show_seconds = float(param) + if show_seconds > 0: + effect_index += 1 + filter_args.append(f"{video_output_str}trim=end={show_seconds}[v_eff{effect_index}]") + video_output_str = f"[v_eff{effect_index}]" ... if self.resolution: filter_args.append(f"{video_output_str}scale={self.resolution.replace('x', ':')}[v]")