-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Timelapse script for sunrise timelapses
- Loading branch information
Konrad Iturbe
committed
Oct 24, 2020
1 parent
2e94115
commit cb0d612
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import sys | ||
import time | ||
from goprocam import GoProCamera, constants | ||
import threading | ||
import logging | ||
|
||
""" | ||
I use PM2 to start my GoPro cameras, using a Raspberry Pi 4, works perfectly. | ||
pm2 start timelapse.py --cron "30 7 * * *" --log timelapse.log --no-autorestart | ||
This script will overrride some settings for reliability: | ||
Voice control: OFF | ||
AutoPower off: NEVER | ||
Beeps: OFF (Do not want the camera beeping at 6AM) | ||
NightLapse configuration left untouched, I recommend always using Auto shutter for sunrise and locking the White Balance to 4000k or higher. | ||
""" | ||
|
||
|
||
def start_timelapse(interface): | ||
gopro = GoProCamera.GoPro(ip_address=GoProCamera.GoPro.getWebcamIP( | ||
interface), camera=constants.gpcontrol, webcam_device=interface) | ||
logging.info( | ||
"Started goprocam instance with interface {}".format(interface)) | ||
gopro.gpControlSet(constants.Setup.VOICE_CONTROL, | ||
constants.Setup.VoiceControl.OFF) | ||
gopro.gpControlSet(constants.Setup.AUTO_OFF, constants.Setup.AutoOff.Never) | ||
logging.info("All config set") | ||
gopro.mode(constants.Mode.MultiShotMode, | ||
constants.Mode.SubMode.MultiShot.NightLapse) | ||
gopro.shutter(constants.start) | ||
logging.info("Started timelapse") | ||
|
||
|
||
cameras = sys.argv[1] | ||
cameras = cameras.split(",") | ||
|
||
for interface in cameras: | ||
thr = threading.Thread(target=start_timelapse, args=(interface,)) | ||
thr.start() |