I prefer using Furnace's Deflicker tool, but you can achieve reasonably good results with a pixel analyser node as well.

Examples are quite easy to find though... This one is directly copied from...