[FFmpeg-user] exponential decay, is it possible?

Michael Koch astroelectronic at t-online.de
Sun Aug 5 21:16:59 EEST 2018


>>
>> Every time when the input becomes brighter than the last output frame,
>> the output is set to the input value. If input is below the last output
>> value, then exponential decay.
>> I have a timelapse video of the night sky with meteors. Each meteor is
>> visible only in one frame. I'd like to make them visible a little
>> longer, decaying over several frames.
>>
>> Example:
>> Input   Output
>> 0     0
>> 1     1            // set to input value
>> 0     0.95      // exponential decay begins
>> 0     0.90
>> 0.50     0.86
>> 0.50     0.81     // until here
>> 0.90     0.90     // now set again to input value, because input is
>> brighter
>> 0.90     0.90     // keep at the same level
>> 0.60     0.86     // exponential decay begins
>> 0.60     0.81
>> 0.60     0.77
> If it is calculating global luma instead of local one, it can be added
> to deflicker filter.
> Otherwise you will need to write new video filter.

Unfortunately I can't write a new filter. I think the closest match to 
begin with is the new tmix filter.
tmix calculates a weighted average of the last n frames.
What I need is to apply weights to the last n frames, and then use the 
brightest pixel out of those frames. The last frame would get weight 1, 
and the previous frames get smaller weights according to the exponential 
decay function.

Michael



More information about the ffmpeg-user mailing list