Skip to content

Commit fe94303

Browse files
Fix assumed frameprops error message
1 parent c1d7d72 commit fe94303

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

vspreview/core/types/video.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,25 @@ def prepare_vs_output(self, clip: vs.VideoNode, pack_rgb: bool = True, fmt: vs.V
277277
heuristics, assumed_props = video_heuristics(clip, True, assumed_return=True)
278278
dither_type = DitherType(self.main.toolbars.playback.settings.dither_type.lower())
279279

280+
assumed_values = {
281+
'_Matrix': heuristics.get('matrix_in'),
282+
'_Transfer': heuristics.get('transfer_in'),
283+
'_Primaries': heuristics.get('primaries_in'),
284+
'_ColorRange': heuristics.get('range_in'),
285+
'_ChromaLocation': heuristics.get('chromaloc_in'),
286+
}
287+
280288
if self._stateset and assumed_props:
281-
logging.warn(f'Video Node {self.index}: Had to assume these props which were unspecified or non-valid for preview <"{', '.join(assumed_props)}>')
289+
assumed_info = [
290+
f'{prop}={int(assumed_values.get(prop))} ({assumed_values.get(prop).pretty_string})' # type:ignore
291+
for prop in assumed_props
292+
]
293+
294+
logging.warn(
295+
f'Video Node {self.index}: The following frame properties had to be assumed for previewing: '
296+
f'<{", ".join(assumed_info)}>\nYou may want to set explicit frame properties instead. '
297+
'See https://www.vapoursynth.com/doc/apireference.html#reserved-frame-properties for more information.'
298+
)
282299

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

0 commit comments

Comments
 (0)