[FFmpeg-user] Average a "rolling" N frames?

Paul B Mahol onemda at gmail.com
Thu Apr 21 10:03:01 EEST 2022


On Thu, Apr 21, 2022 at 7:03 AM Steven Kan <steven at kan.org> wrote:

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


tmix by default does rolling average if you use no other filters.


>
>
> 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?
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list