mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
Cleanup unnecessary code in FFMPEG
This commit is contained in:
@@ -47,7 +47,7 @@ class BaseRenderEngine(object):
|
|||||||
def worker_class(): # override when subclassing to link worker class
|
def worker_class(): # override when subclassing to link worker class
|
||||||
raise NotImplementedError("Worker class not implemented")
|
raise NotImplementedError("Worker class not implemented")
|
||||||
|
|
||||||
def get_help(self):
|
def get_help(self): # override if renderer uses different help flag
|
||||||
path = self.renderer_path()
|
path = self.renderer_path()
|
||||||
if not path:
|
if not path:
|
||||||
raise FileNotFoundError("renderer path not found")
|
raise FileNotFoundError("renderer path not found")
|
||||||
@@ -56,7 +56,7 @@ class BaseRenderEngine(object):
|
|||||||
return help_doc
|
return help_doc
|
||||||
|
|
||||||
def get_project_info(self, project_path, timeout=10):
|
def get_project_info(self, project_path, timeout=10):
|
||||||
raise NotImplementedError(f"get_project_info not implemented for {cls.__name__}")
|
raise NotImplementedError(f"get_project_info not implemented for {self.__name__}")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_output_formats(cls):
|
def get_output_formats(cls):
|
||||||
@@ -66,6 +66,9 @@ class BaseRenderEngine(object):
|
|||||||
def get_arguments(cls):
|
def get_arguments(cls):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def get_options(self): # override to return options for ui
|
||||||
|
return {}
|
||||||
|
|
||||||
def perform_presubmission_tasks(self, project_path):
|
def perform_presubmission_tasks(self, project_path):
|
||||||
return project_path
|
return project_path
|
||||||
|
|
||||||
|
|||||||
@@ -10,15 +10,9 @@ class FFMPEGRenderWorker(BaseRenderWorker):
|
|||||||
|
|
||||||
engine = FFMPEG
|
engine = FFMPEG
|
||||||
|
|
||||||
def __init__(self, input_path, output_path, args=None, parent=None, name=None):
|
def __init__(self, input_path, output_path, engine_path, args=None, parent=None, name=None):
|
||||||
super(FFMPEGRenderWorker, self).__init__(input_path=input_path, output_path=output_path, args=args,
|
super(FFMPEGRenderWorker, self).__init__(input_path=input_path, output_path=output_path,
|
||||||
parent=parent, name=name)
|
engine_path=engine_path, args=args, parent=parent, name=name)
|
||||||
|
|
||||||
stream_info = subprocess.check_output([self.renderer_path, "-i", # https://stackoverflow.com/a/61604105
|
|
||||||
input_path, "-map", "0:v:0", "-c", "copy", "-f", "null", "-y",
|
|
||||||
"/dev/null"], stderr=subprocess.STDOUT).decode('utf-8')
|
|
||||||
found_frames = re.findall('frame=\s*(\d+)', stream_info)
|
|
||||||
self.project_length = found_frames[-1] if found_frames else '-1'
|
|
||||||
self.current_frame = -1
|
self.current_frame = -1
|
||||||
|
|
||||||
def generate_worker_subprocess(self):
|
def generate_worker_subprocess(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user