See the sample script I posted above at: http://www.raspberrypi.org/phpBB3/viewt ... 47#p467547rleyden wrote: I already tried the setting you suggested and it works somewhat better for twilight and is therefore useful for that. However, leaving the camera with that setting gives totally washed out daytime images. If it was mentioned in this thread how to get useful images with the full range of light conditions with one setting or script, I missed it. Is there such a setting?
This will step between automatic exposure with the night setting (which works fine in daylight) and the maximum exposure currently available using sports mode (with the longer shutter speed and timeout settings/trick). If you want to use this for a time-lapse with a more accurate interval, you'll need to set the time (before running raspistill) in a variable and compare against it rather than using the sleep 60 command in the script. Something like this would do the trick:
Code: Select all
#!/bin/bash
lightValueTimesTen=150
while [ true ]; do
start=`date +%s`
if [ "$lightValueTimesTen" -lt 15 ]; then
timeout=10000
exposure="sports --shutter 1000000"
elif [ "$lightValueTimesTen" -lt 25 ]; then
timeout=5000
exposure="sports --shutter 800000"
else
timeout=5000
exposure="night"
fi
outputfile="pi`date +%s`.jpg"
raspistill --exposure $exposure --output "$outputfile" --verbose --timeout $timeout
lightValue=`exiftool "$outputfile" -LightValue | sed "s/.*: //"`
lightValueTimesTen=`echo "$lightValue * 10" | bc -l | sed "s/\..*//"`
next=`expr $start + 60`
if [ "`date +%s`" -lt "$next" ]; then
echo "waiting for next shot"
while [ "`date +%s`" -lt "$next" ]; do
sleep 1
done
fi
done