My video file has some blackish frames (it's almost black, but not exactly black, i.e. #000000), and I want to filter out them, replacing them with neighboring frames.
However, I can't find a simple way to do that.
Of course, I can extract all the frame images from the video file with FFmpeg:
ffmpeg -i foo.mp4 -an -framerate 30 -s 1280x720 -f image2 foo-%05d.jpeg
and then list all the blackish images with some image tools, replace them with neighboring-numbered files, and merge them:
ffmpeg -i foo.mp4 -vn -acodec copy foo.m4a
ffmpeg -i foo.m4a -f image2 -framerate 30 -i foo-%05d.jpeg -r 30 -s 1280x720 output.mp4
but this will create over 10,000 intermediate image files and it is also time-consuming.
Is there any software or programming language that helps this work?
I am using Windows x64.