[FFmpeg-user] drawtext from filename + rolling average?

Steven Kan steven at kan.org
Sat May 20 22:13:10 EEST 2023

Last year y’all helped me make a time-lapse video of bees building comb, with each frame being a rolling average of N images, 

ffmpeg -hwaccel videotoolbox -framerate 60 -pattern_type glob -i '*.jpg' -c:v h264_videotoolbox -b:v 100M tmix=frames=50:weights="1”: CombLapse.mp4

with the results at:


Thank you!

Last year I was using stills from an IP security camera that burns in the date/time stamp:


In pursuit of a better images this year I’m using an old Nikon d70s dSLR and grabbing jpgs using gphoto from an RPi. AFAICT the d790s does _not_ have the ability to burn in a date/time stamp, but I am recording the date/time both in the EXIF and as the filename:


(no one has moved in yet this year)

How can I read the filenames, reformat "2023-05-18-20-46-37” into "05/18/23 08:46:37” and then feed that to drawtext whilst also doing my 50 frame average? e.g. I’d like my first output frame to be the 50th jpg in the directory, with the video data being the average of 1-50, but the drawtext being just the modified version of my 50th filename (e.g. so I don’t get the blurring of the timestamp as I did in last year’s video).

I don’t want to do a two-pass process to burn the timestamp into the jpgs and then make the time-lapse video, because then I’ll have excess generation loss from two rounds of decompression/recompression. But it would be Ok to do one pass to create text file(s) with the desired drawtext for each frame.

Can this be done? 


More information about the ffmpeg-user mailing list