diff options
Diffstat (limited to 'libmat2/video.py')
| -rw-r--r-- | libmat2/video.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libmat2/video.py b/libmat2/video.py index 1492ba1..2b33bc0 100644 --- a/libmat2/video.py +++ b/libmat2/video.py | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | import subprocess | ||
| 1 | import functools | 2 | import functools |
| 2 | import os | 3 | import os |
| 3 | import logging | 4 | import logging |
| @@ -5,7 +6,7 @@ import logging | |||
| 5 | from typing import Dict, Union | 6 | from typing import Dict, Union |
| 6 | 7 | ||
| 7 | from . import exiftool | 8 | from . import exiftool |
| 8 | from . import subprocess | 9 | from . import bubblewrap |
| 9 | 10 | ||
| 10 | 11 | ||
| 11 | class AbstractFFmpegParser(exiftool.ExiftoolParser): | 12 | class AbstractFFmpegParser(exiftool.ExiftoolParser): |
| @@ -33,9 +34,12 @@ class AbstractFFmpegParser(exiftool.ExiftoolParser): | |||
| 33 | '-flags:a', '+bitexact', # don't add any metadata | 34 | '-flags:a', '+bitexact', # don't add any metadata |
| 34 | self.output_filename] | 35 | self.output_filename] |
| 35 | try: | 36 | try: |
| 36 | subprocess.run(cmd, check=True, | 37 | if self.sandbox: |
| 37 | input_filename=self.filename, | 38 | bubblewrap.run(cmd, check=True, |
| 38 | output_filename=self.output_filename) | 39 | input_filename=self.filename, |
| 40 | output_filename=self.output_filename) | ||
| 41 | else: | ||
| 42 | subprocess.run(cmd, check=True) | ||
| 39 | except subprocess.CalledProcessError as e: | 43 | except subprocess.CalledProcessError as e: |
| 40 | logging.error("Something went wrong during the processing of %s: %s", self.filename, e) | 44 | logging.error("Something went wrong during the processing of %s: %s", self.filename, e) |
| 41 | return False | 45 | return False |
