summaryrefslogtreecommitdiff
path: root/libmat2/video.py
diff options
context:
space:
mode:
authorintrigeri2019-02-03 09:43:27 +0000
committerjvoisin2019-02-03 19:18:41 +0100
commite8c1bb0e3c4cae579e81ce6a4b01b829900ff922 (patch)
treecd7146283c98f25544334cdd322b8c577ccc40d3 /libmat2/video.py
parent8b5d0c286c91537b43eb3284aa93b382636e7ebf (diff)
Whenever possible, use bwrap for subprocesses
This should closes #90
Diffstat (limited to 'libmat2/video.py')
-rw-r--r--libmat2/video.py6
1 files changed, 4 insertions, 2 deletions
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 @@
1import os 1import os
2import subprocess
3import logging 2import logging
4 3
5from typing import Dict, Union 4from typing import Dict, Union
6 5
7from . import exiftool 6from . import exiftool
7from . import subprocess
8 8
9 9
10class AbstractFFmpegParser(exiftool.ExiftoolParser): 10class AbstractFFmpegParser(exiftool.ExiftoolParser):
@@ -32,7 +32,9 @@ class AbstractFFmpegParser(exiftool.ExiftoolParser):
32 '-flags:a', '+bitexact', # don't add any metadata 32 '-flags:a', '+bitexact', # don't add any metadata
33 self.output_filename] 33 self.output_filename]
34 try: 34 try:
35 subprocess.check_call(cmd) 35 subprocess.run(cmd, check=True,
36 input_filename=self.filename,
37 output_filename=self.output_filename)
36 except subprocess.CalledProcessError as e: 38 except subprocess.CalledProcessError as e:
37 logging.error("Something went wrong during the processing of %s: %s", self.filename, e) 39 logging.error("Something went wrong during the processing of %s: %s", self.filename, e)
38 return False 40 return False