Skip to content

Commit

Permalink
webui: timelapse plugin creates a helper script for assembling a video.
Browse files Browse the repository at this point in the history
  • Loading branch information
themactep committed Nov 1, 2024
1 parent 2d7039a commit 7739239
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion overlay/lower/usr/sbin/timelapse
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ snapshot=/tmp/snapshot.jpg
[ -z "$timelapse_interval" ] && timelapse_interval=1

target="$timelapse_storage/$(date +"$timelapse_filename")"
mkdir -p "$(dirname "$target")"
targetdir="$(dirname "$target")"
mkdir -p "$(dirname "$targetdir")"
[ -w "$targetdir" ] || die "Cannot write to $targetdir"

converter="$targetdir/convert2video.sh"
if [ ! -f "$converter" ]; then
echo "#/bin/sh
ffmpeg -r 10 -f image2 -pattern_type glob -i '*.jpg' -vcodec libx264 -an timelapse.mp4
" > "$converter"
chmod +x "$converter"
fi

[ -f "$snapshot" ] || die "Cannot find a snapshot"
cp -v "$snapshot" "$target"
Expand Down

0 comments on commit 7739239

Please sign in to comment.