I need to get the max Y-value per frame and just got stuck with all that runtime stuff.
So, how do I get a variable for the maximim Y value and (depending on that variable) do something to the clip:
if Y > 16 --> autolevel
--> do nothing
+ Reply to Thread
Results 1 to 7 of 7
Runtime filters (eg AverageLuma, YPlaneMax) can only be used with runtime functions (eg conditional filter, scriptclip)
src=last src #your filter here filtered=last ConditionalFilter(src, filtered, src, "YPlaneMax", ">", "16", show=true)
It works. Not perfect but result is much better than before. The problem I'm having with all "autolevels" scripts/plugins is that they also
"crank-up" black fades and crossfades, which looks really bad.
After setting the Y-level to 40 almost every frame in the fade/crossfade remains dark except a few at the start and end.
I can live with that though.
Thanks again for your help!
Have you tried the other "autolevels" plugins ? (there are a few variations of "autolevels", and a different one called "autogain" by lato) . Lato's works the best overall IMO, but "auto" anything is prone to problems in general . It has a dark_exclude parameter which allows you to exclude a percentage of the darkest pixels in the minima calulation
I tried all of them. From ColorTuv(autogain=true) to several VD-filters. Also Lato's.
They all fail when handling fades-in or crossfades thru black.
But when using your script and setting the minY level to 75, the results are quite acceptable.
Thanks again PDR!
PeterNL, out of curiosity why do you need this?
I got some old super8 homevideos laserscanned to lossless AVI.
The luma-levels are not constant and vary a lot because of the lousy camera i had at that time
Beside that, I will put them only on my Dune mediaplayer so there is no need for studio-levels either and I prefer 0-255 levels.
Doing this manually is a nogo so autolevels is my way to go.
I edit them, render the complete project to some lossless codec and push them thru avisynth/virtualdub to get the right levels which worked well, except for the fades/crossfades. Finally I render to X264.