user21686: I have problematic footage from diving due to my camera/SD card - every 4th or so frame is just black, and I want to replace all those black frames with either an interpolation between the previous and next frame or just duplicate the previous frame. 
I found this question "remove black frames from vob files with ffmpeg", but I don't want to cut out the frames but instead want to interpolate between the two frames or duplicate the previous frame. 
I think I might be able to get all the relevant positions with the black-frame filters etc, but what kind of actions would I use to replace those frames with an interpolation or a duplicate of the previous frame in a fully automatic way (so I only pass my movie file into the script)? 
All I've found so far is the "shuffleframes" method, which I could somehow (how?) feed with the position of the black frames and then thereby duplicate the previous frame.
Demo footage detailing the probem can be found here.

user1871: It's possible to have the black frames removed and earlier frames duplicated.
ffmpeg -i in.mp4 -vf blackframe=0,metadata=select:key=lavfi.blackframe.pblack:value=50:function=less -vsync cfr -c:a copy out.mp4

The blackframe filter analyses and registers the proportion of a frame's pixels which are black. The metadata filter keeps all frames which have at most 50% of pixels black. The removed frames create a gap in the video stream. So by setting the video sync method to constant frame rate, ffmpeg duplicates earlier (non-black) frames to fill in those gaps.
You'll have to experiment with the metadata selection value 50 to get the right threshold.

21686: <p>I have problematic footage from diving due to my camera/SD card - every 4th or so frame is just black, and I want to replace all those black frames with either an interpolation between the previous and next frame or just duplicate the previous frame. </p>

<p>I found this question <a href="https://video.stackexchange.com/questions/10383/remove-black-frames-from-vob-files-with-ffmpeg">"remove black frames from vob files with ffmpeg"</a>, but I don't want to cut out the frames but instead want to interpolate between the two frames or duplicate the previous frame. </p>

<p>I think I might be able to get all the relevant positions with the black-frame filters etc, but what kind of actions would I use to replace those frames with an interpolation or a duplicate of the previous frame in a fully automatic way (so I only pass my movie file into the script)? </p>

<p>All I've found so far is the "shuffleframes" method, which I could somehow (how?) feed with the position of the black frames and then thereby duplicate the previous frame.</p>

<p>Demo footage detailing the probem can be found <a href="https://cl.ly/qCr1" rel="nofollow noreferrer">here</a>.</p>
 1871: <p>It's possible to have the black frames removed and earlier frames duplicated.</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>The blackframe filter analyses and registers the proportion of a frame's pixels which are black. The metadata filter keeps all frames which have at most 50% of pixels black. The removed frames create a gap in the video stream. So by setting the video sync method to constant frame rate, ffmpeg duplicates earlier (non-black) frames to fill in those gaps.</p>

<p>You'll have to experiment with the metadata selection value <code>50</code> to get the right threshold.</p>
