How to use the goprocam.constants.Camera function in goprocam

To help you get started, we’ve selected a few goprocam examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github KonradIT / gopro-py-api / goprocam / GoProCamera.py View on Github external
exit()
        self.ip_addr = ip_address
        self._camera = ""
        self._mac_address = mac_address
        self._debug = debug
        try:
            from getmac import get_mac_address
            self._mac_address = get_mac_address(ip=self.ip_addr)
        except ImportError:
            self._mac_address = mac_address
        if camera == "detect":
            self._camera = self.whichCam()
        elif camera == "startpair":
            self.pair()
        else:
            if camera == constants.Camera.Interface.Auth or camera == "HERO3" or camera == "HERO3+" or camera == "HERO2":
                self.power_on_auth()
                time.sleep(2)
                self._camera = constants.Camera.Interface.Auth
            else:
                self._camera = constants.Camera.Interface.GPControl
                self.power_on(self._mac_address)
                self._prepare_gpcontrol()
            print("Connected to " + self.ip_addr)
github KonradIT / gopro-py-api / goprocam / GoProCamera.py View on Github external
def livestream(self, option):
        """start livestreaming
        option = "start"/"stop"
        """
        if option == "start":
            if self.whichCam() == constants.Camera.Interface.GPControl:
                return self.gpControlExecute(
                    "p1=gpStream&a1=proto_v2&c1=restart")
            else:
                return self.sendCamera("PV", "02")
        if option == "stop":
            if self.whichCam() == constants.Camera.Interface.GPControl:
                return self.gpControlExecute("p1=gpStream&a1=proto_v2&c1=stop")
            else:
                return self.sendCamera("PV", "00")