summaryrefslogtreecommitdiff
path: root/libmat2/video.py
diff options
context:
space:
mode:
authorjvoisin2019-10-12 16:13:49 -0700
committerjvoisin2019-10-12 16:13:49 -0700
commit5f0b3beb46d09af26107fe5f80e63ddccb127a59 (patch)
treef3d46e6e9dac60daa304d212bed62b17c019f7eb /libmat2/video.py
parent3cef7fe7fc81c1495a461a8594b1df69467536ea (diff)
Add a way to disable the sandbox
Due to bubblewrap's pickiness, mat2 can now be run without a sandbox, even if bubblewrap is installed.
Diffstat (limited to 'libmat2/video.py')
-rw-r--r--libmat2/video.py12
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 @@
1import subprocess
1import functools 2import functools
2import os 3import os
3import logging 4import logging
@@ -5,7 +6,7 @@ import logging
5from typing import Dict, Union 6from typing import Dict, Union
6 7
7from . import exiftool 8from . import exiftool
8from . import subprocess 9from . import bubblewrap
9 10
10 11
11class AbstractFFmpegParser(exiftool.ExiftoolParser): 12class 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