mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
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:
parent
9fbc08dd5e
commit
148ce21a9a
2 changed files with 25 additions and 12 deletions
|
|
@ -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."
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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"]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue