Fixing screen flicker / screen tearing I had some capture issue in OBS, where during certain parts of my screen capture some windows flicker.

Here's a sample of the affected footage:


                
            

I think this should be at least to some degree correctable algorithmically, but I don't know the tools to implement that.

Basically for every pixel in the video stream I'd have to do this:

# we need to compare the same pixel in three consecutive frames

A = pixels[x,y, current_frame]
B = pixels[x,y, current_frame + 1]
C = pixels[x,y, current_frame + 2]

# if two border pixel values are identical, but the middle one is different - we assume that to be a flicker, so we replace the middle frame with the first one
if A == C and B != A:
   pixels[x,y, current_frame + 1] = pixels[x,y, current_frame]

# let's move onto the next frame
current_frame += 1


I wonder if this is possible to do with GLSL - I don't know if it has access to frame history...

Are there any (preferably free, open-source and running on Linux) tools that could do this?
The propose algorithm can be implemented using Blender's Compositor.

Here's a working project file:
https://is.gd/TeA4xC

You need to supply the same video file as input to three input nodes - each with a specified frame offset.

This is capable of removing flickers that last no longer than 1 frame.

I tried using this for my footage, but I had issues with A/V sync after remuxingthe result with the original audio, so I dropped the idea.

Here's how the example clip looks like after being processed with this file:

                
            

You can tell the flicker is much less pronounced. There are some artifacts, but they are way less distracting.

Hopefully someone will find this useful - I ultimately didn't :/

Enjoy.