Allow ExtractOIIOTranscode to pass with a warning if it can't find the RGBA channels in source media instead of raising error

This commit is contained in:
Roy Nieterau 2024-11-06 09:09:12 +01:00
parent 9fbc08dd5e
commit 148ce21a9a
2 changed files with 25 additions and 12 deletions

View file

@ -67,6 +67,11 @@ VIDEO_EXTENSIONS = {
}
class UnknownRGBAChannelsError(ValueError):
"""Raised when we can't find RGB channels for conversion in input media."""
pass
def get_transcode_temp_directory():
"""Creates temporary folder for transcoding.
@ -1427,7 +1432,7 @@ def get_oiio_input_and_channel_args(oiio_input_info, alpha_default=None):
review_channels = get_convert_rgb_channels(channel_names)
if review_channels is None:
raise ValueError(
raise UnknownRGBAChannelsError(
"Couldn't find channels that can be used for conversion."
)

View file

@ -10,6 +10,7 @@ from ayon_core.lib import (
)
from ayon_core.lib.transcoding import (
UnknownRGBAChannelsError,
convert_colorspace,
get_transcode_temp_directory,
)
@ -160,17 +161,24 @@ class ExtractOIIOTranscode(publish.Extractor):
output_path = self._get_output_file_path(input_path,
new_staging_dir,
output_extension)
convert_colorspace(
input_path,
output_path,
config_path,
source_colorspace,
target_colorspace,
view,
display,
additional_command_args,
self.log
)
try:
convert_colorspace(
input_path,
output_path,
config_path,
source_colorspace,
target_colorspace,
view,
display,
additional_command_args,
self.log
)
except UnknownRGBAChannelsError:
self.log.error(
"Skipping OIIO Transcode. Unknown RGBA channels"
f" for colorspace conversion in file: {input_path}"
)
continue
# cleanup temporary transcoded files
for file_name in new_repre["files"]: