Skip to main content

GoPro Camera - Python module made easy.

Project description

A complete Python GoPro module made easy.

GoPro

At the moment this module only works with the newest GoPro Hero 4.

Sadly the earlier versions of GoPro are not backwards/forwards compatible.

Install

Easy install with Github or PyPi

Installing the latest version from GitHub.

$ git clone https://github.com/DenisCarriere/gopro.git
$ cd gopro
$ python setup.py install

Installing the tested version from PyPi.

$ sudo pip install gopro

Quickstart

Once the installation is complete you are ready to start! :)

The default IP address for the GoPro is using 10.5.5.9.

You must first be connected to the GoProApp Wifi connection.

Launch your favorite ipython or standard python

>>> import gopro
>>> camera = gopro.camera()
>>> camera.status
{'connection': 'OK',
 'datetime': '2014-11-12T23:53:59',
 'ip': '10.5.5.9',
 'ok': True,
 'screen': 'video',
 'storage': '31.3 GB',
 'time_offset': 'now'}
...

Take a Photo or Video

With very simple commands you can tell your GoPro to start recording or take a photo.

The screen will automaticly change to the approriate page.

>>> camera.photo()
>>> camera.video()
>>> camera.timelapse()

Camera modes

Makes it easy to cycle threw each available modes.

>>> camera.mode('burst')
>>> camera.mode('photo')
>>> camera.mode('timelapse')
>>> camera.mode('video')
...

Locate (Beep! Beep!)

Can’t find your device?? Call the locate function and it will Beep endlessly until there is no more battery.

To turn off the beeps, simply press the mode button on the device or use the off as a parameter.

>>> camera.locate('on')
>>> camera.locate('off')
...

Sleep

The camera will turn itself off, the Wi-Fi will still be active.

At the moment there is no working commands to turn the device back on.

To reactivate the device, press the mode button.

>>> camera.sleep()
...

Delete Photos

Might be useful to dump all those photos from your GoPro.

Warning once you delete photos/videos you cannot retrieve them back.

The erase function does the same as the delete all.

>>> camera.erase()
>>> camera.delete_all()
>>> camera.delete_last()
...

Settings

You can explore the different types of settings & status by getting the raw JSON response or selecting a specific pre-parsed attribute

Processed attributes

Status - Screen

This will let you know which page your GP is currently active.

There are only 4 available outcomes.

>>> camera.status
'settings'
'video'
'photo'
'timelapse'
...

Raw JSON Responses

The original response from the GoPro device.

>>> camera.settings_raw
>>> camera.status_raw
...

Date & Time

It is a good idea to sync your GoPro with the same clock as your computer.

An easy way to do this is use the datetime & time_offset attribute.

Try to aim your GoPro to have less than 1 second offset.

The time_offset is measured in (+/-) seconds.

>>> camera.datetime
2014-11-12 21:53:09
>>> camera.datetime_offset
-0.320142
...

File Storage

Here is how you can retrieve the total file storage in (KB) or pretty human readeable format.

>>> camera.status_storage
31330144
>>> camera.status['storage']
'31.3 GB'

Debug

Want to explore & troubleshoot the device a bit, you can retrieve the following properties from your device.

>>> camera.debug
>>> camera.info
>>> camera.commands
...

Contributors

A big thanks to all the people who have helped contribute!

To be a contributor, please message me with requests on Twitter/Github issues

License

The MIT License (MIT)

Copyright (c) 2014-2015 Denis Carriere

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gopro-0.0.2.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

gopro-0.0.2-py2.py3-none-any.whl (9.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file gopro-0.0.2.tar.gz.

File metadata

  • Download URL: gopro-0.0.2.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gopro-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a307bc1ba03bc44c724b58b87e8cc1813c134c60ae74979b93a5125f354b53e2
MD5 89cde451c6f5b710971b12302d7a564f
BLAKE2b-256 f75769d09487f5bf325cab0728f761e74a8305608f26843674a9e77c509591ae

See more details on using hashes here.

File details

Details for the file gopro-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for gopro-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7e2ad18f682b5178a3ec6789abbbf904a23e839127925cabc5925a4ea2b4b5cd
MD5 d03e639e9d19baca6e33c984880b4b0d
BLAKE2b-256 aa7c652da2a56a895724e375c5cce902ee5a211aa3b503ae78af71e490f74112

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page