View Full Version : how to setprop to single frame?
tuqc
18th October 2022, 09:23
can ModifyFrame do single frame?
def transfer_property(n, f):
fout = f[1].copy()
fout.props['_Matrix'] = f[0].props['_Matrix']
return fout
...
final=core.std.ModifyFrame(clip=c1, clips=[c1, c2], selector=transfer_property) #this work for clip to clip
#final = core.text.FrameProps(final)
final.set_output()
-------------------------------------
how to set "framenumber(50,71,181)"?
tuqc
18th October 2022, 09:38
trying to edit prop in csv filetype after propextract, maybe someone can help..
_Al_
18th October 2022, 18:57
to copy matrix from c2 clip into c1:
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:
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))
ChaosKing
19th October 2022, 09:59
I would move the frame list outside the function for more flexibility.
I don't have python installed right now to test it
import functools
def transfer_property(n, c1, c2, frames):
if n in frames:
#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, frames=[50,71,181]))
tuqc
20th October 2022, 01:11
to copy matrix from c2 clip into c1:
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:
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))
it work.useful for me.thank u pal
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.