Answers.Body: <p><strong>The propose algorithm can be implemented using Blender's Compositor.</strong></p>
  
  <p>Here's a working project file:
  <a href="https://is.gd/TeA4xC" rel="nofollow noreferrer">https://is.gd/TeA4xC</a></p>
  
  <p>You need to supply the same video file as input to three input nodes - each with a specified frame offset.</p>
  
  <p><strong>This is capable of removing flickers that last no longer than 1 frame.</strong></p>
  
  <p>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.</p>
  
  <p>Here's how the example clip looks like after being processed with this file:
  <div class="youtube-embed"><div>
                  <iframe width="640px" height="395px" src="https://www.youtube.com/embed/VT-KODgUonY?start=0"></iframe>
              </div></div></p>
  
  <p>You can tell the flicker is much less pronounced. There are some artifacts, but they are way less distracting.</p>
  
  <p>Hopefully someone will find this useful - I ultimately didn't :/</p>
  
  <p>Enjoy.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-15T20:51:07.177Z
Answers.LastActivityDate: 2019-08-15T20:51:07.177Z
Answers.UserDisplayName: unfa
Body: <p>I had some capture issue in OBS, where during certain parts of my screen capture some windows flicker.</p>
  
  <p>Here's a sample of the affected footage:</p>
  
  <p><div class="youtube-embed"><div>
                  <iframe width="640px" height="395px" src="https://www.youtube.com/embed/jkbQb-Byjm4?start=0"></iframe>
              </div></div></p>
  
  <p>I think this should be at least to some degree correctable algorithmically, but I don't know the tools to implement that.</p>
  
  <p>Basically for every pixel in the video stream I'd have to do this:</p>
  
  <pre><code># 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
  </code></pre>
  
  <p>I wonder if this is possible to do with GLSL - I don't know if it has access to frame history...</p>
  
  <p>Are there any (preferably free, open-source and running on Linux) tools that could do this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-11T20:31:47.807Z
Comments.Text: 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.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-15T20:44:51.420Z
Comments.Text: 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).
Comments.UserDisplayName: unfa
Tags: <video><ffmpeg><obs>
Title: Fixing screen flicker / screen tearing
UserDisplayName: unfa
ThreadText: # Fixing screen flicker / screen tearing
  
  (Asked by: username_0 on 2019-08-11)
  
  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?
  
  **Tags:** video, ffmpeg, obs
  
  > **Comments:**
  > **username_1**: 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.  
  > **username_0**: 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).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-08-15. Score: 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 :/
  
  Enjoy.
  
  
  ---
  
  