Replace all completely black frames with interpolated frames Due to a bug with Nvidia Shadowplay, I have a bunch of videos that look like this.  A bunch of random frames have been replaced with pure black frames.

I'd like to fix one of these videos to remove the flickering.  I saw an answer here which suggests the following ffmpeg command:

ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less -vsync cfr -c:a copy out.mp4


However, this replaces all the black frames with the most recent non-black frame, which makes the video look like a slideshow.

Is there any way to use a similar ffmpeg command (or any other tool) to use motion interpolation to fix the missing frames?
After poring over the documentation all weekend, I figured out how to use the minterpolate filter to do motion interpolation.  The full command is

ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less,minterpolate=mi_mode=mci:mc_mode=aobmc:me_mode=bidir:vsbmc=1:me=fss -c:a copy out.mp4


These were the settings that gave me the best-looking results.  If these are too slow for you, you can try something like

ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less,minterpolate=mi_mode=mci:mc_mode=obmc:me_mode=bilat:vsbmc=0:me=tdls -c:a copy out.mp4


which went about 3x as fast in my testing.  You can find the documentation on the different minterpolate options here.