Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
530 views
in Technique[技术] by (71.8m points)

How to remove a flickering background image from a video using ffmpeg?

I recorded lectures using OBS and uploaded them to Youtube. Later I found that the recorded videos flicker and show the underlying desktop image. The flickering really disturbs but it would be a huge effort to record everything from scratch.

I can extract the unwanted image from the video. Is there a way to identify this image (or parts of it) in the recorded videos and remove them? Or somehow reduce the flickering? Here is an example of a flickering video.

I'm not very good with ffmpeg. I've tried to reduce the flicker with this

ffmpeg -i in.mp4 -vf "tblend=average,framestep=2,setpts=1*PTS" -r 10 out.mp4

It reduces the disco effect but leaves heavy shadows of the background image.

I also tried to identify the corrupted frames with something like this

ffmpeg -i in.mp4 -r 1 -loop 1 -i background.png -filter_complex "blend=difference:shortest=1,blackframe=30:20" -f null -

but I'm not sure if it is the right approach and how to continue from this.

I believe that my command reports the frames that match the image. I thought that it would be possible to replace those frames with white and then use blending to fill in the missing bits. Ideally I'd like to do all that with a single command. Any help is much appreciated!

question from:https://stackoverflow.com/questions/65880623/how-to-remove-a-flickering-background-image-from-a-video-using-ffmpeg

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...