From 290da368dc5b876783582715e077707708173730 Mon Sep 17 00:00:00 2001 From: Markus Wang Halvorsen Date: Fri, 24 Mar 2023 01:47:36 +0100 Subject: [PATCH] ffmpeg argument order trimming would sometimes break --- footgas/worker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/footgas/worker.py b/footgas/worker.py index 6092394..9d29cec 100644 --- a/footgas/worker.py +++ b/footgas/worker.py @@ -41,8 +41,9 @@ def save_clip(self): trimmed_file = f'{self.file}-TRIMMED.tmp' subprocess.run([ 'ffmpeg', '-y', '-hide_banner', '-loglevel', 'error', + '-ss', f'{self.start}', # order matters. must be before -i + '-to', f'{self.end}', '-i', f'{self.file}', - '-c', 'copy', '-ss', f'{self.start}', '-to', f'{self.end}', '-f', 'mp4', f'{trimmed_file}', ], creationflags=self.NO_WINDOW_FLAG)