[FFmpeg-user] Average a "rolling" N frames?
Steven Kan
steven at kan.org
Thu Apr 21 08:03:14 EEST 2022
I’m putting together a time-lapse video of bees building comb in the hive. I have 5,000+ jpgs (and growing!) in a directory that I process with:
ffmpeg -hwaccel videotoolbox -framerate 60 -pattern_type glob -i '*.jpg' -c:v h264_videotoolbox -b:v 100M CombLapse.mp4
which results in:
https://www.youtube.com/watch?v=CvGAHWVcbwY
Someone suggested that I try to “remove the bees” and get video of just the comb. Which got me thinking, what if I could do a rolling average of, say, 100 frames? So frame 1 of my output would be the average of frames 1 - 100, and frame 2 of my output would be the average of frames 2 - 101, etc.
I’ve used -vf tmix=frames=10:weights=“1” to take 10 frames of input and output 1 frame, but what syntax could I use to do a rolling average?
Or would I have to loop through the jpgs twice? Once to get 4,900 averaged stills and then another run to combine those into my video?
More information about the ffmpeg-user
mailing list