A new kind of deflicker filter, please!

Website, builds, or other suggestions.
Post Reply
AlanR
Posts: 1
Joined: Tue Oct 31, 2017 7:08 am

A new kind of deflicker filter, please!

Post by AlanR » Tue Oct 31, 2017 8:18 am

I'm brand new to this forum, and I came here in the hopes of addressing a problem I've encountered, with a proposal/suggestion.

My BIG suggestion is for a new kind of deflicker filter in ffmpeg. I've tried using the existing deflicker filter on a video clip with numerous sudden bright flashes, and it only succeeded in making the changes in brightness occur in "soft waves" instead of sudden flashes -- it did not eliminate the varying brightness. My video clip, as I believe would often be the case, has certain regions of the frame that are merely "static background"; the only variation in brightness that occurs within these regions is due to the flickering that the clip suffers from. I believe that a way to actually eliminate the video's "flashes" would be to define a small region of the frame by x and y (such as 3x3 pixels) that is part of the "static background", and establish a "control luminance" for this small region by reading the luminance of this region in, say, the video's third frame, and then for all subsequent frames, read the luminance of the same region, and, when it becomes brighter, reduce the luminance of the entire frame to keep the luminance in the small region constant. (And "vice-versa" when the luminance of the region drops.) It'd probably be necessary to be able to adjust the "strength" of the effect, perhaps to possibly "overcompensate" for measured variation due to the chosen region being only "partially sensitive" to the flickering brightness; conversely it'd surely also be good to be able to have a "reduced/partial compensation" lest the effect be "exaggerated". Also, it might be useful if the effect could be made less sensitive to, or even ignored outright, small variations, giving more emphasis to larger discrepancies (or not) -- a kind of "gamma curve" for the effect.

Failing that new feature, my SMALL suggestion is to introduce a "utility function" that reads and returns a value for the luminance (which I surmise is what the existing deflicker filter is already doing internally, in order to calculate a running "mean") of a small (like one pixel, or of varied size, like 3x3 pixels "averaged", etc.) region of the frame defined by x and y (and size). The value of this function could be used to formulate an action like the filter I described above, wherein the value is read in the third frame and saved to an internal variable to establish a "control"; and then in subsequent frames read again and compared to the 'control' to calculate a value to be used in, say, the eq filter "brightness" parameter for that frame, to compensate for changes that occur.

Thanks very much in advance!

Post Reply
'