user43: 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?

user1871: After removing the black frames, you can insert the framerate filter to fill the gaps with blended frames.
ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less,framerate=fps=60000/1001 -c:a copy out.mp4

See docs for framerate filter. The filter will produce a CFR stream so vsync is not required.

user43: 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.

43: <p>Due to a bug with Nvidia Shadowplay, I have a bunch of videos that <a href="https://gfycat.com/uglymerryarctichare" rel="nofollow noreferrer">look like this</a>.  A bunch of random frames have been replaced with pure black frames.</p>

<p>I'd like to fix one of these videos to remove the flickering.  I saw an answer <a href="https://video.stackexchange.com/questions/23589/replace-black-frames-with-previous-frames">here</a> which suggests the following ffmpeg command:</p>

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

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

<p>Is there any way to use a similar ffmpeg command (or any other tool) to use motion interpolation to fix the missing frames?</p>
 1871: <p>After removing the black frames, you can insert the framerate filter to fill the gaps with blended frames.</p>

<pre><code>ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less,framerate=fps=60000/1001 -c:a copy out.mp4
</code></pre>

<p>See docs for framerate filter. The filter will produce a CFR stream so vsync is not required.</p>
 43: <p>After poring over the documentation all weekend, I figured out how to use the minterpolate filter to do motion interpolation.  The full command is</p>

<pre><code>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
</code></pre>

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

<pre><code>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
</code></pre>

<p>which went about 3x as fast in my testing.  You can find the documentation on the different minterpolate options <a href="https://ffmpeg.org/ffmpeg-filters.html#minterpolate" rel="nofollow noreferrer">here</a>.</p>
