From e8c1bb0e3c4cae579e81ce6a4b01b829900ff922 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 3 Feb 2019 09:43:27 +0000 Subject: Whenever possible, use bwrap for subprocesses This should closes #90 --- libmat2/video.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libmat2/video.py') diff --git a/libmat2/video.py b/libmat2/video.py index 825df92..9dc13e1 100644 --- a/libmat2/video.py +++ b/libmat2/video.py @@ -1,10 +1,10 @@ import os -import subprocess import logging from typing import Dict, Union from . import exiftool +from . import subprocess class AbstractFFmpegParser(exiftool.ExiftoolParser): @@ -32,7 +32,9 @@ class AbstractFFmpegParser(exiftool.ExiftoolParser): '-flags:a', '+bitexact', # don't add any metadata self.output_filename] try: - subprocess.check_call(cmd) + subprocess.run(cmd, check=True, + input_filename=self.filename, + output_filename=self.output_filename) except subprocess.CalledProcessError as e: logging.error("Something went wrong during the processing of %s: %s", self.filename, e) return False -- cgit v1.3