You can do it via ffmpeg. I have a Reolink which ftp's the image every 15 seconds and at midnight I automatically create a movie. This is the script I use.
#!/bin/bash
#Set Date
FDATE=$(date +%m%d%Y)
YEAR=$(date +%Y)
MONTH=$(date +%m)
DAY=$(date +%d)
sleep 120
#Rename Files, needed for ffmpeg
cd /volume1/Camera/incoming/$YEAR/$MONTH/$DAY
ls *.jpg | cat -n | while read n f; do mv "$f" "$(printf webcam_%04d.jpg $n)"; done
#Create Movies`
ffmpeg -framerate 30 -i webcam_%04d.jpg -codec copy webcam$FDATE.mkv
mv *.mkv /volume1/Camera/movies
#Cleanup old videos and pictures
/bin/find /volume1/Camera/movies/ -mtime +30 -name '*.*' -exec rm -f {} \;
/bin/find /volume1/Camera/incoming/$YEAR/* -mtime +7 -exec rm {} \;