View Single Post
Old 18th October 2022, 18:57   #3  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 321
to copy matrix from c2 clip into c1:
Code:
def transfer_property(n, f):
    fout = f[0].copy()
    if n in [50,71,181]:
        fout.props['_Matrix'] = f[1].props['_Matrix']
    return fout
...
final=core.std.ModifyFrame(clip=c1, clips=[c1, c2], selector=transfer_property)
but that does not guarantee it will be converted to rgb correctly for those frames, outside of vapoursynth (maybe even inside, not sure now, edit: yes, inside vs, resize func with RGB conversion will read props from each frame)
to fix it right away, seems kind of unlikely just to fix matrix in some frames, but anyway:
Code:
import functools
def transfer_property(n, c1,c2):
    if n in [50,71,181]:
        #c1 gets matrix out prop from c2 and gets fixed
        return c1.resize.Bicubic(matrix_in=c2.get_frame(n).props['_Matrix'], matrix=c1.get_frame(n).props['_Matrix'])
    return c1
...
final=core.std.FrameEval(c1, functools.partial(transfer_property, c1=c1,c2=c2))

Last edited by _Al_; 18th October 2022 at 19:20.
_Al_ is offline   Reply With Quote