Skip to content

Commit

Permalink
Add Timelapse script for sunrise timelapses
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Iturbe committed Oct 24, 2020
1 parent 2e94115 commit cb0d612
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions examples/hero9_timelapse_webcam.py
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()

0 comments on commit cb0d612

Please sign in to comment.