Updates review extract to improve quality

Improves review extraction by:

- Switches output extension to '.png' for better image quality.
- Adds compression level to ffmpeg command.
- Adds scaling to the video filter.
- Forces re-encoding for lossy formats.
This commit is contained in:
Jakub Jezek 2025-04-09 15:38:19 +02:00
parent ebeb1d1e19
commit f66ff742f7
No known key found for this signature in database
GPG key ID: 06DBD609ADF27FD9

View file

@ -54,7 +54,7 @@ class ExtractOTIOReview(
# plugin default attributes
to_width = 1280
to_height = 720
output_ext = ".jpg"
output_ext = ".png"
def process(self, instance):
# Not all hosts can import these modules.
@ -474,6 +474,7 @@ class ExtractOTIOReview(
command.extend([
"-start_number", str(in_frame_start),
"-compression_level", "5",
"-framerate", str(sequence_fps),
"-i", input_path
])
@ -510,6 +511,11 @@ class ExtractOTIOReview(
"-tune", "stillimage"
])
if video or sequence:
command.extend([
"-vf", f"scale={self.to_width}:{self.to_height}:flags=lanczos"
])
# add output attributes
command.extend([
"-start_number", str(out_frame_start)
@ -520,9 +526,12 @@ class ExtractOTIOReview(
input_extension
and self.output_ext == input_extension
):
command.extend([
"-c", "copy"
])
if input_extension.lower() in [
'.png', '.tif', '.tiff', '.dpx', '.exr']:
command.extend(["-c", "copy"])
else:
# For lossy formats, force re-encode
command.extend(["-pix_fmt", "rgba"])
# add output path at the end
command.append(output_path)