mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
Ability to set custom start / end frames (#14)
* Accept start / end frames in job submissions. Start / end frame support for Blender * Remove old render_all_frames variables and misc cleanup * Client work - Client determines frame count for FFMPEG and shows frame picker UI
This commit is contained in:
@@ -22,20 +22,34 @@ class FFMPEG(BaseRenderEngine):
|
||||
|
||||
@classmethod
|
||||
def get_encoders(cls):
|
||||
encoders_raw = subprocess.check_output([cls.renderer_path(), '-encoders'], stderr=subprocess.DEVNULL,
|
||||
raw_stdout = 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)]
|
||||
encoders = [m.groupdict() for m in re.finditer(pattern, raw_stdout)]
|
||||
return encoders
|
||||
|
||||
@classmethod
|
||||
def get_all_formats(cls):
|
||||
formats_raw = subprocess.check_output([cls.renderer_path(), '-formats'], stderr=subprocess.DEVNULL,
|
||||
raw_stdout = 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)]
|
||||
formats = [m.groupdict() for m in re.finditer(pattern, raw_stdout)]
|
||||
return formats
|
||||
|
||||
@classmethod
|
||||
def get_output_formats(cls):
|
||||
return [x for x in cls.get_all_formats() if 'E' in x['type'].upper()]
|
||||
return [x for x in cls.get_all_formats() if 'E' in x['type'].upper()]
|
||||
|
||||
@classmethod
|
||||
def get_frame_count(cls, path_to_file):
|
||||
raw_stdout = subprocess.check_output([cls.renderer_path(), '-i', path_to_file, '-map', '0:v:0', '-c', 'copy',
|
||||
'-f', 'null', '-'], stderr=subprocess.STDOUT,
|
||||
timeout=SUBPROCESS_TIMEOUT).decode('utf-8')
|
||||
match = re.findall(r'frame=\s*(\d+)', raw_stdout)
|
||||
if match:
|
||||
frame_number = int(match[-1])
|
||||
return frame_number
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(FFMPEG.get_frame_count('/Users/brett/Desktop/Big_Fire_02.mov'))
|
||||
Reference in New Issue
Block a user