One of the projects I work on at Purdue is installing cameras and capturing time lapse pictures of all major construction projects. You can find all of these documented at https://engineering.purdue.edu/ECN/Webcam. Getting the cameras installed and then capturing all the pictures, usually one every 10 minutes, is the easy part. It took me a bit longer to get all the details correct to actually make decent looking videos out of the images.
Once I start working on a particular time lapse, I usually start by taking one picture from each day, usually around 2pm. Because these cameras are all capturing pictures outside, it’s important to go through and cull them to get rid of any with rain drops on the camera lens, sun flare, snow, etc. Then I use the following ffmpeg command to make the video file. These assume you have jpg files named in date order like strftime('%Y%m%d%H%M')
.
ffmpeg -hwaccel auto -framerate 24 -pattern_type glob -i '*.jpg' -c:v libx264 -pix_fmt yuv420p output.mp4
One can twiddle a bit with the framerate parameter depending on how long you want the final video to last.
Once I have the video done, I add branding to it and this is where the ffmpeg commands looks particularly scary.
ffmpeg -i output.mp4 -i PU-H-Full-RGB-50.png \
-filter_complex "
[0] [1] overlay=x=10:y=50 [b];
[b] drawtext=fontfile=UnitedSansCdBd.otf:text='Ross-Ade South Endzone': x=700: y=50:fontsize=64 [c];
[c] drawtext=fontfile=UnitedSansCdBd.otf:text='timelapse by Andrew Sydelko':x=705:y=125:fontsize=24"\
output-with-overlay.mp4
This takes the input video file from the previous step and the input png file which is a logo. The logo is overlayed at coordinates x=10,y=50 and adds two sets of text with specified fonts and different sizes at the two different coordinates.
Leave a Reply