diff options
| author | intrigeri | 2019-02-03 09:43:27 +0000 |
|---|---|---|
| committer | jvoisin | 2019-02-03 19:18:41 +0100 |
| commit | e8c1bb0e3c4cae579e81ce6a4b01b829900ff922 (patch) | |
| tree | cd7146283c98f25544334cdd322b8c577ccc40d3 /libmat2/video.py | |
| parent | 8b5d0c286c91537b43eb3284aa93b382636e7ebf (diff) | |
Whenever possible, use bwrap for subprocesses
This should closes #90
Diffstat (limited to 'libmat2/video.py')
| -rw-r--r-- | libmat2/video.py | 6 |
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 @@ | |||
| 1 | import os | 1 | import os |
| 2 | import subprocess | ||
| 3 | import logging | 2 | import logging |
| 4 | 3 | ||
| 5 | from typing import Dict, Union | 4 | from typing import Dict, Union |
| 6 | 5 | ||
| 7 | from . import exiftool | 6 | from . import exiftool |
| 7 | from . import subprocess | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | class AbstractFFmpegParser(exiftool.ExiftoolParser): | 10 | class 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 |
