Log in

View Full Version : Resize crash with Transfer or Primaries


MysteryX
11th October 2021, 17:36
If I set transfer or primaries parameter to resize, it crashes with a memory exception. Anyone ever uses that?


clean = clip.resize.Bicubic(format=vs.YUV444P16, primaries=1)


I'm trying to convert back from RGBS while respecting source attributes, and it's almost working except these 2 attributes.


# Convert back while respecting _ColorRange of each frame. Note that setting range=1 sets _ColorRange=0 (reverse)
def ConvertBack(n, f, clip, format):
fullRange = "_ColorRange" in f.props and f.props["_ColorRange"] == 0
matrix = "_Matrix" in f.props and f.props["_Matrix"] or 1
if matrix == 2:
matrix = 1
transfer = "_Transfer" in f.props and f.props["_Transfer"] or 1
if transfer == 2:
transfer = matrix
primaries = "_Primaries" in f.props and f.props["_Primaries"] or 1
if primaries == 2:
primaries = matrix
chroma = "_ChromaLocation" in f.props and f.props["_ChromaLocation"] or 0
return clip.resize.Bicubic(format=format, matrix=matrix, chromaloc=chroma, range = 1 if fullRange else 0)
# transfer=transfer, primaries=primaries