Remove Old Multi-Client Code / Refactoring (#13)

* Remove a lot of old code from render_queue regarding clients

* More code cleanup

* More code cleanup

* Move everything around

* Minor log change
This commit is contained in:
2023-06-11 14:50:20 -05:00
committed by GitHub
parent 86a1dae5b6
commit 94bb1e4362
22 changed files with 66 additions and 210 deletions

View File

@@ -0,0 +1,41 @@
try:
from .base_engine import *
except ImportError:
from base_engine import *
import re
class FFMPEG(BaseRenderEngine):
@classmethod
def version(cls):
version = None
try:
ver_out = subprocess.check_output([cls.renderer_path(), '-version'],
timeout=SUBPROCESS_TIMEOUT).decode('utf-8')
match = re.match(".*version\s*(\S+)\s*Copyright", ver_out)
if match:
version = match.groups()[0]
except Exception as e:
logger.error("Failed to get FFMPEG version: {}".format(e))
return version
@classmethod
def get_encoders(cls):
encoders_raw = subprocess.check_output([cls.renderer_path(), '-encoders'], stderr=subprocess.DEVNULL,
timeout=SUBPROCESS_TIMEOUT).decode('utf-8')
pattern = '(?P<type>[VASFXBD.]{6})\s+(?P<name>\S{2,})\s+(?P<description>.*)'
encoders = [m.groupdict() for m in re.finditer(pattern, encoders_raw)]
return encoders
@classmethod
def get_all_formats(cls):
formats_raw = subprocess.check_output([cls.renderer_path(), '-formats'], stderr=subprocess.DEVNULL,
timeout=SUBPROCESS_TIMEOUT).decode('utf-8')
pattern = '(?P<type>[DE]{1,2})\s+(?P<name>\S{2,})\s+(?P<description>.*)'
formats = [m.groupdict() for m in re.finditer(pattern, formats_raw)]
return formats
@classmethod
def get_output_formats(cls):
return [x for x in cls.get_all_formats() if 'E' in x['type'].upper()]