master
Holger Wirtz 5 years ago
parent cdf4b7d0a7
commit e748ffb44e
  1. 8
      bin/timelapse_monthly.sh
  2. 12
      bin/timelapse_video.sh

@ -6,11 +6,13 @@ DATA="${MOUNT_PATH}/timelapse"
CLIENT="timelapse@192.168.111.2"
CLIENT_FOLDER="/timelapse"
set -x
if [[ "${1}" =~ [01]*[0-9] ]]
if [[ "${1}" =~ [0-9]+ ]]
then
MONTH=${1}
if [ ${MONTH} -lt 10 ]
then
MONTH="0${MONTH}"
fi
else
MONTH=`date --date="1 month ago" +%m`
fi

@ -8,19 +8,23 @@ DATA_FOLDER=""
case ${1} in
daily)
DATA_FOLDER="${1}"
DATA_FOLDER="daily"
FILE_NAME="${DATA_FOLDER}_`date +%Y%m%d`"
DATE=`date --date="1 day ago" +%Y%m%d`
;;
weekly)
DATA_FOLDER="${1}"
DATA_FOLDER="weekly"
FILE_NAME="${DATA_FOLDER}_`date +%Y_%V`"
DATE=`date --date="1 week ago" +%Y%m%d`
;;
monthly)
DATA_FOLDER="${1}"
DATA_FOLDER="monthly"
FILE_NAME="${DATA_FOLDER}_`date +%Y_%m`"
DATE=`date --date="1 month ago" +%Y%m%d`
;;
*)
DATA_FOLDER="yearly"
FILE_NAME="${DATA_FOLDER}_`date +%Y`"
DATE=`date +%Y%m%d`
;;
esac
@ -44,4 +48,4 @@ then
fi
# sort files
ffmpeg -y -loglevel quiet -framerate 30 -pattern_type glob -i "${DATA}/${DATA_FOLDER}/*.jpg" -vcodec libx265 -crf 20 -vf scale=1920:1080 "${DATA}/video/${DATA_FOLDER}_${DATE}.mp4"
ffmpeg -y -loglevel quiet -framerate 30 -pattern_type glob -i "${DATA}/${DATA_FOLDER}/*.jpg" -vcodec libx265 -crf 20 -vf scale=1920:1080 "${DATA}/video/${FILE_NAME}.mp4"

Loading…
Cancel
Save