Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th October 2022, 09:23   #1  |  Link
tuqc
Registered User
 
Join Date: Aug 2020
Posts: 31
how to setprop to single frame?

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)"?

Last edited by tuqc; 18th October 2022 at 20:16.
tuqc is offline   Reply With Quote
Old 18th October 2022, 09:38   #2  |  Link
tuqc
Registered User
 
Join Date: Aug 2020
Posts: 31
trying to edit prop in csv filetype after propextract, maybe someone can help..

Last edited by tuqc; 18th October 2022 at 20:30.
tuqc is offline   Reply With Quote
Old 18th October 2022, 18:57   #3  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 255
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
Old 19th October 2022, 09:59   #4  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,716
I would move the frame list outside the function for more flexibility.
I don't have python installed right now to test it

PHP Code:
import functools
def transfer_property
(nc1c2frames):
    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(c1functools.partial(transfer_propertyc1=c1c2=c2frames=[50,71,181])) 
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database || https://github.com/avisynth-repository
ChaosKing is offline   Reply With Quote
Old 20th October 2022, 01:11   #5  |  Link
tuqc
Registered User
 
Join Date: Aug 2020
Posts: 31
Quote:
Originally Posted by _Al_ View Post
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))
it work.useful for me.thank u pal
tuqc is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.