From 38df679a88a19db3a4a82fdb8e20a42c9a53d1a1 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 22 Oct 2018 19:12:39 +0200 Subject: Optimize the handling of problematic files --- libmat2/video.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'libmat2/video.py') diff --git a/libmat2/video.py b/libmat2/video.py index 2fa65e8..fe2a1af 100644 --- a/libmat2/video.py +++ b/libmat2/video.py @@ -24,10 +24,9 @@ class AVIParser(exiftool.ExiftoolParser): 'SampleRate', 'AvgBytesPerSec', 'BitsPerSample', 'Duration', 'ImageSize', 'Megapixels'} - - def __remove_all_internal(self, filename: str): + def remove_all(self): cmd = [_get_ffmpeg_path(), - '-i', filename, # input file + '-i', self.filename, # input file '-y', # overwrite existing output file '-loglevel', 'panic', # Don't show log '-hide_banner', # hide the banner @@ -38,11 +37,8 @@ class AVIParser(exiftool.ExiftoolParser): '-flags:v', '+bitexact', # don't add any metadata '-flags:a', '+bitexact', # don't add any metadata self.output_filename] - subprocess.check_call(cmd) - - def remove_all(self) -> bool: try: - self._handle_problematic_filename(self.__remove_all_internal) + subprocess.check_call(cmd) except subprocess.CalledProcessError as e: logging.error("Something went wrong during the processing of %s: %s", self.filename, e) return False -- cgit v1.3