mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Read pixel aspect from input
This commit is contained in:
parent
2175874686
commit
103c8cd56e
2 changed files with 18 additions and 3 deletions
|
|
@ -242,7 +242,7 @@ class ExtractSlateFrame(publish.Extractor):
|
|||
|
||||
# render slate as sequence frame
|
||||
nuke.execute(
|
||||
instance.data["name"],
|
||||
str(instance.data["name"]),
|
||||
int(slate_first_frame),
|
||||
int(slate_first_frame)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -86,8 +86,11 @@ class ExtractReviewSlate(publish.Extractor):
|
|||
input_width,
|
||||
input_height,
|
||||
input_timecode,
|
||||
input_frame_rate
|
||||
input_frame_rate,
|
||||
input_pixel_aspect
|
||||
) = self._get_video_metadata(streams)
|
||||
if input_pixel_aspect:
|
||||
pixel_aspect = input_pixel_aspect
|
||||
|
||||
# Raise exception of any stream didn't define input resolution
|
||||
if input_width is None:
|
||||
|
|
@ -421,6 +424,7 @@ class ExtractReviewSlate(publish.Extractor):
|
|||
input_width = None
|
||||
input_height = None
|
||||
input_frame_rate = None
|
||||
input_pixel_aspect = None
|
||||
for stream in streams:
|
||||
if stream.get("codec_type") != "video":
|
||||
continue
|
||||
|
|
@ -438,6 +442,16 @@ class ExtractReviewSlate(publish.Extractor):
|
|||
input_width = width
|
||||
input_height = height
|
||||
|
||||
input_pixel_aspect = str(stream.get("sample_aspect_ratio"))
|
||||
if input_pixel_aspect is not None:
|
||||
try:
|
||||
input_pixel_aspect = float(
|
||||
eval(input_pixel_aspect.replace(':', '/')))
|
||||
except Exception:
|
||||
self.log.debug(
|
||||
"__Converting pixel aspect to float failed: {}".format(
|
||||
input_pixel_aspect))
|
||||
|
||||
tags = stream.get("tags") or {}
|
||||
input_timecode = tags.get("timecode") or ""
|
||||
|
||||
|
|
@ -448,7 +462,8 @@ class ExtractReviewSlate(publish.Extractor):
|
|||
input_width,
|
||||
input_height,
|
||||
input_timecode,
|
||||
input_frame_rate
|
||||
input_frame_rate,
|
||||
input_pixel_aspect
|
||||
)
|
||||
|
||||
def _get_audio_metadata(self, streams):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue