From 887a1c3d34f3a4ef9522580993db410a9e2244f8 Mon Sep 17 00:00:00 2001 From: saurabh Date: Wed, 25 Mar 2020 19:08:49 +0530 Subject: [PATCH] annotation bug fix --- common/videoRecorder.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/videoRecorder.py b/common/videoRecorder.py index 988ad00..0ffa289 100644 --- a/common/videoRecorder.py +++ b/common/videoRecorder.py @@ -35,16 +35,19 @@ def __init__(self, filename, fourcc, fps, frameSize=None,limit_fps=False, base_d if timestamp_filename: self.filename_pattern = '%s-%s%s'%(self.filename, '{}', self.file_extension) - self.filename_pattern_annotations = '%s-%s%s'%(self.filename, '{}', self.annotations_extension) + if self.annotations: + self.filename_pattern_annotations = '%s-%s%s'%(self.filename, '{}', self.annotations_extension) self.cleanup_pattern = '.*%s-%s%s'%(self.filename, '.*', self.file_extension) else: self.filename_pattern = '%s%s'%(self.filename, self.file_extension) - self.filename_pattern_annotations = '%s-%s'%(self.filename, self.annotations_extension) + if self.annotations: + self.filename_pattern_annotations = '%s-%s'%(self.filename, self.annotations_extension) self.cleanup_pattern = '.*%s%s'%(self.filename, self.file_extension) if base_dir: self.filename_pattern = os.path.join(base_dir, self.filename_pattern) - self.filename_pattern_annotations = os.path.join(base_dir,self.filename_pattern_annotations) + if self.annotations: + self.filename_pattern_annotations = os.path.join(base_dir,self.filename_pattern_annotations) self.base_dir = base_dir else: self.base_dir = os.path.dirname(self.filename)