-
Notifications
You must be signed in to change notification settings - Fork 0
/
lapse2.sh
executable file
·78 lines (70 loc) · 1.4 KB
/
lapse2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
# Take pictures with raspberry pi camera for timelapse creation
# NOTE: created for personal use, however you may alter it as you please
# Run as SU
# mount disk
flag=true
while $flag; do
read -p "press 1 for WD or press 2 for intenso [1/2]: " choice
if [ $choice == "1" ]
then
echo "you chose WD"
ntfs-3g /dev/sda1 /media/Tough
flag=false
elif [ $choice == "2" ]
then
echo "you chose intenso"
mount /dev/sda1 /media/Tough
flag=false
else
echo "choose wisely"
fi
done
chmod 775 /media/Tough
chmod 775 /media/Tough/lapse
# resolution
while ! $flag; do
echo -e "choose frame resolution:\n1.720p\n2.1080p\n3.2K"
read res
if [ $res == "1" ]
then
ww=1280
hh=720
flag=false
elif [ $res == "2" ]
then
ww=1920
hh=1080
flag=false
elif [ $res == "3" ]
then
ww=2560
hh=1440
flag=false
else
echo "choose wisely"
fi
done
# time period
while ! $flag; do
read -p "enter minutes [reminder: 5 hours = 300 minutes]: " period
if [[ $period =~ [0-9] ]]
then
period=$[period*60000]
flag=true
else
echo "choose wisely"
fi
done
# interval
while $flag; do
read -p "enter interval in miliseconds [reminder: 1000ms = 1sec]: " interval
if [[ $interval =~ [0-9] ]]
then
flag=false
else
echo "choose wisely"
fi
done
# take images, no preview, x&y inverted, resolution, period, interval, 4 digits name, saved as jpg
raspistill -bm -hf -vf -w $ww -h $hh -t $period -tl $interval -o /media/Tough/lapse/image%04d.jpg &