Skip to content

Commit

Permalink
Improve assumed props warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Oct 8, 2024
1 parent c1d7d72 commit e89dfcd
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion vspreview/core/types/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,26 @@ def prepare_vs_output(self, clip: vs.VideoNode, pack_rgb: bool = True, fmt: vs.V
heuristics, assumed_props = video_heuristics(clip, True, assumed_return=True)
dither_type = DitherType(self.main.toolbars.playback.settings.dither_type.lower())

assumed_values = {
'_Matrix': heuristics.get('matrix_in'),
'_Transfer': heuristics.get('transfer_in'),
'_Primaries': heuristics.get('primaries_in'),
'_ColorRange': heuristics.get('range_in'),
'_ChromaLocation': heuristics.get('chromaloc_in'),
}

if self._stateset and assumed_props:
logging.warn(f'Video Node {self.index}: Had to assume these props which were unspecified or non-valid for preview <"{', '.join(assumed_props)}>')
assumed_info = [
f'{prop}={int(value)} ({value.pretty_string})' # type: ignore
for prop, value in assumed_values.items()
if prop in assumed_props
]

logging.warn(
f'Video Node {self.index}: The following frame properties had to be assumed for previewing: '
f'<{", ".join(assumed_info)}>\nYou may want to set explicit frame properties instead. '
'See https://www.vapoursynth.com/doc/apireference.html#reserved-frame-properties for more information.'
)

standard_gamut = {'transfer': Transfer.BT709, 'primaries': self.main.settings.output_primaries_zimg}

Expand Down

0 comments on commit e89dfcd

Please sign in to comment.