So when you can load the 2.0x filters into avisynth 2.5x with that loadpluginex.dll , how come Sampler.dll doesn't work with AviSynth2.5x ?
:roll: |
Sampler does work in AVS2.5.1 and should work since v0.2. I use it all the time, just remember to use sampler-2.5.dll instead of sampler.dll . They're both in the same package.
|
Well, after spending an entire Saturday trying to modify this script I have accomplished precisely nothing, except learning a whole lot about how NOT to write a script. :roll: Not being a programmer type, I'm afraid my scripting skills just aren't up to the task. So I will throw a few random brain droppings out for you all, and maybe somebody with more scripting ability can make some of it work.
The first thing I noticed when I added the subtitle function in Sagittaire's latest script that he posted was how very little of the movie was being classified as high motion. I'm using a James Bond movie as my sample, and there were ski chases, car chases, fistfights, and a climactic shootout that never really got above medium. That led me to believe the threshold values need to be tweaked a little. I reduced threshold_hm to 10, and that bought me about 100k off my file size. But then I started noticing some scenes where there was a sharp threshold cutoff and there was a noticeable shift in the luma blurring. So then I started thinking along the lines of what kwag mentioned that maybe we need more than 3 brackets to give a better range of values that will both compress better and make the threshold transitions smoother. Like maybe 5 brackets. I spent most of the day today trying to add two new brackets for "VERY LOW" and "VERY HIGH" and set the thresholds at 3, 6, 9, 12 and 15. But somehow I just can't get both the logic and the syntax right. Along the way, my Detect_Motion function got quite long and cumbersome, so I started trying to find a way to simplify it. As I said, I'm not a programmer type, so this may be totally off the wall, but..... I started trying to create a function that would perform the operation Code:
output1 = Conditionalfilter( Courant_fr, Low, Medium, "YDifferenceFromPrevious() + UDifferenceFromPrevious() + VDifferenceFromPrevious()", "<", "threshold_sm", false) But studying up on that led me to the ConditionalFilter docs at AVISynth.org: http://www.avisynth.org/index.php?pa...ditionalFilter I discovered that if you add the line Code:
ScriptClip(clip, "Subtitle(String(YDifferenceFromPrevious() + UDifferenceFromPrevious() + VDifferenceFromPrevious()))") So here's where my thought is right now: Can we use FrameEvaluate to simply analyze the frame for motion without doing anything to it, and then put that result into a variable? I'm wondering if that could be the first step toward creating kwag's dynamic range of values..... Ideas? Or do I need to go back to my day job? :lol: |
Quote:
That's why I suggested the filter to be linear, instead of being in three ranges, where a sharp cut-off/turn-on WILL happen the way the script is currently set. 8) Quote:
Quote:
Quote:
Quote:
Quote:
Stick along, I'm pretty sure that in the next ~30 days, this will convert to a whole new monster :mrgreen: -kwag |
Quote:
|
Quote:
-kwag |
Quote:
Code:
function Detect_Motion( clip detect, clip Slow, clip Medium, clip Hight, float threshold_sm, float threshold_hm) |
Quote:
|
What happened to this one? Is anyone still working on it? it sounds so good, that I'm thinking about trying it out...
How come nobody seems to care about this thread anymore? |
Here you go Kwag. This is a new script that does linear filtering.
Code:
Version().ConvertToYV12().FadeIn(150).FadeOut(30) Regards, Tenra |
Hi Tenra,
Thanks for the script :) After looking at AviSynth's reference manual and your script, I've come up with a single line solution to the problem :!: ScriptClip("val=YDifferenceFromPrevious()/14.55" + "val > MaxThreshold ? MergeLuma(blur(MaxThreshold)) : MergeLuma(blur( val ))") So now a script will look something like this: Code:
LoadPlugin("C:\Filters25\MPEG2Dec3.dll") Now we have a linear value applied to mergeluma, depending on activity from the previous frame. It works FLAWLESSLY :mrgreen: Because we now have a dynamic range, we can use a value from 0 to 1.58 and the file size difference is HUGE, compared to using a static 0.2 value for luma. I've set the function so that it also protects the value not going above the max value allowed. ( I just love the "?" C's conditional operator :wink: ) -kwag |
That sounds GREAT!! I'll try the script out tomorrow... FANTASTIC!!
How would you limit the max value to let's say 0.8... I wouldn't go any further than that on the LumaBlur... :wink: So this is only for AviSynth 2.51 right? :? By the way, TemporalSmoother is not available for AviSynth 2.51... So we gotta find something different there! |
Quote:
So we can take advantage of this. If you still want to limit, just change the line "MaxThreshold=1.58" to 0.8 :wink: Quote:
Quote:
-kwag |
If you want to see the value being applied dynamically to mergeluma, add the line in bold:
ScriptClip("val=YDifferenceFromPrevious()/14.55" + "val > MaxThreshold ? MergeLuma(blur(MaxThreshold)) : MergeLuma(blur( val ))") ScriptClip("Subtitle(String(val))") Of course, the max value will be 1.58, even if it shows spikes above that value!. Now open your .avs in VirtualDub and have some fun :) -kwag |
Is file prediction posible with this new script :?: :?
|
Quote:
Add these lines to the bottom of your script: interval = round((FrameCount/24)/60) # Interval spacing nFrames = 24 # Frames per sample SelectRangeEvery( (round(framecount/interval)),nFrames) That's for the full sampler, and for NTSC FILM. PAL people, change the (24) to (25). If encoding a 29.97fps NTSC movie, change it to (30) -kwag |
Then i guess is back to work for Hedix & Muaddib. :D
|
Here's the fixed prediction lines for 10% : 100%:
Code:
interval = round((FrameCount/24)/60) # Full sample. |
Quote:
|
Here's a small clip, showing (as a numeric subtitle) the value being applied dynamically to each frame by the function :wink:
www.kvcd.net/dynamic-adapt.mpg -kwag |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.