I use a GoPro Max 360-degree camera for my daily Still Standing recordings. Unfortunately, I discovered too late that the camera’s default 60fps setting can cause flickering issues with certain indoor lighting here in Norway, where our electrical system operates at 25 Hz.

Fortunately, I found a solution to remove flickering due to artificial light using my favourite terminal tool FFmpeg. The technique works by averaging pixel values between the original frame and a slightly delayed copy, smoothing out flicker from artificial lighting.

ffmpeg -fflags +genpts -i input.mp4 -fflags +genpts -i input.mp4 -filter_complex “[0:v]setpts=PTS-STARTPTS[top]; [1:v]setpts=PTS-STARTPTS+.033/TB, format=yuva420p, colorchannelmixer=aa=0.5[bottom]; [top][bottom]overlay=shortest=1” -c:v libx264 -crf 26 -an output.mp4

These are some of the tricks used:

  • -fflags +genpts: Generates presentation timestamps for reliable frame timing
  • -filter_complex: Complex filtergraph with multiple steps:
    • [0:v]setpts=PTS-STARTPTS[top]: First video stream, reset timestamps to start at 0
    • [1:v]setpts=PTS-STARTPTS+.033/TB: Second stream offset by ~33ms (one frame at 30fps)
    • format=yuva420p: Convert to format supporting alpha channel
    • colorchannelmixer=aa=0.5: Set opacity to 50%
    • [top][bottom]overlay=shortest=1: Blend streams with 50% opacity

It is not perfect, and it would obviously be best to avoid the problem by using 25 or 50 fps to begin with. However, if you already have a problematic recording, it can help in rescuing the file for further processing.