Hello! I studied Computer Science, and live in Bath. I write code, design games, and occasionally tweet.
Hello! I studied Computer Science, and live in Bath. I write code, design games, and occasionally tweet.

How to use Avisynth+ to remove mains flicker Dec. 22, 2023 in Text

Earlier this month I recorded the BathTub Orchestra performing at Christ Church in Bath, but when I went to edit the video so I could upload it to YouTube, there was a distracting flickering in the top left and top right of the screen! I’ve been using the powerful Davinci Resolve, and while it does have a deflickering filter, it unfortunately is a paid feature.

Fortunately, the free and open-source Avisynth+ can be used to quickly remove the flicker. These are the steps that worked for me, and I’m writing them down in case I ever need to make use of the them again. Hopefully someone out there finds them helpful.

  1. Download and install the latest version of ffmpeg from https://www.ffmpeg.org/download.html
  2. Download and install the latest version of Avisynth+ from https://github.com/AviSynth/AviSynthPlus/releases
  3. Download and copy the latest version of the Avisynth+ ReduceFlicker plugin from https://github.com/Asd-g/ReduceFlicker/releases into AviSynth+’s plugins64+ folder
  4. (Optionally) download and install the latest version of AvsPmod from https://github.com/gispos/AvsPmod/releases, the AviSynth+ and plugins folders may need to be updated
  5. Using AvsPmod or any text editor to create a file named deflicker.avs containing something like:
DirectShowSource("video.mp4")
ConvertToYUV420()
ReduceFlicker(aggressive = true, strength = 3)

More information about the ReduceFlicker plugin can be found at http://avisynth.nl/index.php/ReduceFlicker.

  1. Using the command line, run the following command
ffmpeg.exe -i deflicker.avs -vcodec libx264 -vb 20M -acodec libfaac deflickered.mp4

Consider adjusting the bitrate to something sensible, and changing the video/audio codec to match the input.

And that’s it, hope it helped! Here’s the final result:

And here’s a YouTube playlist.

BathTub Orchestra at the Larkhall Festival May. 1, 2022 in Flute, Music, Orchestra, Photos, Videos

BathTub Orchestra at the Larkhall Festival

I completed the Southampton Half Marathon 2022 Apr. 24, 2022 in Photos, Sport, Text

I completed the Southampton Half Marathon in 1:56:01, without stopping.

I completed the Southampton Half Marathon in 1:56:01, without stopping.

I Completed Fleet Half Marathon 2022 Mar. 20, 2022 in Photos, Sport, Text

I completed the Fleet Half Marathon in 1:51:22, a new personal best!

I completed the Fleet Half Marathon in 1:51:22, a new personal best!

BathTub Orchestra at St. Swithin's Mar. 19, 2022 in Flute, Music, Orchestra, Photos, Videos

BathTub Orchestra at St. Swithin's BathTub Orchestra at St. Swithin's

Slava Ukraini Mar. 7, 2022 in Photos

Slava Ukraini

Donate to the British Red Cross.

BathTub Orchestra Preparing for Christmas Nov. 30, 2021 in Flute, Music, Orchestra, Photos, Videos

BathTub Orchestra Preparing for Christmas BathTub Orchestra Preparing for Christmas

I Completed Farnborough Half Marathon 2021 Jul. 11, 2021 in Photos, Sport, Text

I completed the Farnborough Half Marathon in 1:52:02

I completed the Farnborough Half Marathon in 1:52:02.

BathTub Orchestra Garden Concert Jun. 27, 2021 in Flute, Music, Orchestra, Photos, Videos

BathTub Orchestra Garden Concert BathTub Orchestra Garden Concert

donk.mp4 Apr. 7, 2021 in Games, Videos

donk.mp4 donk.mp4
Get an email when I post, zero spam     Get an email when I post     Newsletter