From 51f6e44cacc80e82f6d9397c2903e44fd36f36a2 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Fri, 4 Mar 2022 15:06:35 +0200 Subject: [PATCH] try to handle quotes in filenames --- tsmark/__init__.py | 2 +- tsmark/video_annotator.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tsmark/__init__.py b/tsmark/__init__.py index 82af21d..0ba227a 100644 --- a/tsmark/__init__.py +++ b/tsmark/__init__.py @@ -1,7 +1,7 @@ from tsmark.video_annotator import Marker import argparse -VERSION = "0.4.2" +VERSION = "0.4.3" def get_options(): diff --git a/tsmark/video_annotator.py b/tsmark/video_annotator.py index 9d7db68..43abae4 100755 --- a/tsmark/video_annotator.py +++ b/tsmark/video_annotator.py @@ -265,11 +265,11 @@ class Marker: print("# {}: {} / {}".format(i + 1, self.format_time(ts), ts + 1)) if len(self.stamps) > 0: print( - "ffmpeg -i '{}' -ss {} -to {} -c copy '{}.trimmed.mp4'".format( - self.opts.video, + 'ffmpeg -i "{}" -ss {} -to {} -c copy "{}.trimmed.mp4"'.format( + self.opts.video.replace('"','\\"'), self.format_time(self.stamps[0]), self.format_time(self.stamps[-1]), - self.opts.video, + self.opts.video.replace('"','\\"'), ) )