-
Notifications
You must be signed in to change notification settings - Fork 2
/
m-shooot-bulb
executable file
·44 lines (42 loc) · 1.19 KB
/
m-shooot-bulb
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
#!/bin/bash
trap close INT
function close() {
echo "Interrupted."
exit 0
}
this="$(realpath $(dirname "$0"))"
duration="$1"
if [ -z "$duration" ]; then
read -p "Shutter speed (bulb mode, seconds): " duration
fi
$this/set/iso "$2"
$this/set/aperture "$3"
$this/set/auto-dark "$4"
folder="$5"
if [ -z "$folder" ]; then
read -e -p "Folder: " folder
fi
cd "$folder"
count="$6"
if [ -z "$count" ]; then
read -p "Number of photos: " count
fi
interval="$7"
if [ -z "$interval" ]; then
read -p "Interval (seconds): " interval
fi
delay=2
for run in {1..${count}}; do
gphoto2 --set-config shutterspeed=Bulb --set-config capturetarget=1 --set-config bulb=1 --wait-event=${duration}s --set-config bulb=0 --quiet
sleep $delay
$this/get-last-photo .
sleep $((interval-delay))
done
if [ -n "$(find . -maxdepth 1 -type f -iname "*.nef" -o -iname "*.cr2" -o -iname "*.crw" -o -iname "*.pef" -o -iname "*.arw" -o -iname "*.sr2" -o -iname "*.raw" -o -iname "*.dng")" ]; then
if [ "$(python2 ${this}/py/get-filetype.py -c)" != "NEF+Fine" ]; then
read -p "Convert RAW images (y/n)?" convert
if [ "$convert" = "y" ]; then
${this}/raw/convert-all-raw
fi
fi
fi