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]")