Ready_Eddie
21st January 2006, 15:34
Do any of the script gurus out there know how to get a script to evaluate and delete frames/fields on the fly? Somehow with per frame FameEvaluates and ScriptClip I would guess.
Didée
21st January 2006, 19:32
Please describe what exactly you want to do, that could not be achieved with a "normal" deinterlacer?
The *general* answer to your question is: Not at all, this cannot be done.
Means: ScriptClip & Co. basically work like "one frame in, one frame out." ... each input frame is evaluated by ScriptClip, and it has to give out something, too. It is not possible to get a frame into ScriptClip, and then decide "IF [condition] THEN put out nothing".
There are possible scenarios where you could do some basic integer decimation, like put out one frame for every two input frames, or for every three, or s-th like that. But for more general tasks of decimation, it just can't be done this way.
(If it was possible, Restore24 would work this way ... but for exactly abovementioned reasons I have to use external decimators in R24.)
Ready_Eddie
22nd January 2006, 00:25
Thank for responding Didée, I've seen many of your R24 posts and I was hoping to get someone with your level of experience.
I'm still in trial and error mode, so I can't say exactly what I'm trying to do. That is, I don't know what I'll try next. Pattern's of blended fields, you bet.
My mission today is similar to what Kevin Atkinson suggests in his SmartDecimate writeup:
Use SmartDecimate(1,1) and then attempt to pick out the non-blurred frames by only choosing frames that are duplicated at least once.
By the way, I stumbled across something that might do evaluated decimation, or at least get close. Try this:
showframenumber()
FrameEvaluate("myclip=last",after_frame=true)
FrameEvaluate("offset=(current_frame==0)?0:offset",after_frame=true)
FrameEvaluate("offset=(current_frame==6)?offset+1:offset",after_frame=true)
FrameEvaluate("offset=(current_frame==8)?offset+1:offset",after_frame=true)
FrameEvaluate("offset=(current_frame==15)?offset+1:offset",after_frame=true)
ScriptClip("myclip.selectevery(framecount(myclip),current_frame+offset)",after_frame=true)
it should give back frames 0,1,2,3,4,5, ,7, 8, ,10,11,12,13,14,15,16, ,18, ...
or this:
showframenumber()
FrameEvaluate("myclip=last",after_frame=true)
FrameEvaluate("offset=(current_frame==0)?0:offset",after_frame=true)
FrameEvaluate("offset=(current_frame%5==0)?offset+1:offset",after_frame=true)
ScriptClip("myclip.selectevery(framecount(myclip),current_frame+offset)",after_frame=true)
which should give back ,1,2,3,4,5, ,7,8,9,10,11, ,13,14,15,16,17, ,19, ...
I didn't think this would be able to navigate backwards, but it seems to. Do you know why?
Please let me know if you get the same and think it is useful ...
scharfis_brain
22nd January 2006, 00:36
@Didee: actually I had sucess building an IVTC only using AVS and masktools.dll!
one need two chained conditional environments:
1) flag = clip.environment1(detecting frametype and pattern offset and put out a defined luma value)
2) flag=changefps(23.976)
3) clip.environment2(flag,some steered selectevery commands according to the luma values in flag)
Didée
22nd January 2006, 01:15
@Didee: actually I had sucess _building an IVTC only using AVS and masktools.dll_!
[...some very tricky stuff...]
*
Nice solution - I always feared chaining several instances of conditional ENVs ... :scared:
May we see the script? Surely that would make a nice thread (and the thread title you gave already in the first sentence - I marked by underscore ;) )
Do you think that could be modified for R24 (where frames most probably would be marked by LL (Lauflicht ;) ) ?
Because, the pattern might not be strictly regular, and ATM I don't fully see how to evaluate such marking in order to correctly feed/setup the SelectEvery command. Point is, you know it has always bugged me that within the *inner* core of R24, we already "do know" which frames are which ... but then the information is kinda thrown away, and the cleaned stream given to the decimator, which then has "to start from scratch". Conceptually, this is frustrating ...
Mug Funky
23rd January 2006, 10:38
ooh, i did one too, the exact way (choose an appropriate selectevery by checking if certain frames are dupes).
it was slow as hell.
... i was just about to post the code from my avs graveyard, but realised it wasn't in a condition to work at all from all the hacking i did to fit it with my specific needs.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.