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?

  • ffmpeg could be made to do this, although your proposed method would not get rid of all flicker. If there's some screen activity/anim then A != C, and won't alter B even when B is defective. Also, in one or two cases, the tear lasts for more than one frame.
    – Gyan
    Aug 11, 2019 at 20:31
  • I've implemented this using Blender's Compositor - it seemed to help a bit for short clips, but I had trouble with A/V sync so I dropped the idea. I'm including this in an answer however in case anyone wants to try this in their own projects. I'd like to know more about the ffmpeg-based solution though, as that might be much faster to process (the Blender implementation was rather slow).
    – unfa
    Aug 15, 2019 at 20:44

1 Answer 1


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 :/


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.