How Can I Remove Flickering Background in a Video?
For those classic Video Processing operations there is nothing better than the Plug In's of AviSynth.

Specifically for De Flickering look at:


LMFlicker.
ReduceFlicker.
DeFlicker.


The source code of each is available so you can get inspiration from them.

All of them basically works on smoothing the Luma Data along the temporal dimension.