In [1]:
import time
import numpy as np
import matplotlib.pyplot as plt
import data_io
import exiftool
import IPython
import context
import gopro_helper as gopro
%matplotlib notebook
%load_ext autoreload
%autoreload 2
In [ ]:
In [2]:
IPython.display.display(IPython.display.HTML(data="""
<style>
div#notebook-container { width: 95%; }
div#menubar-container { width: 65%; }
div#maintoolbar-container { width: 99%; }
</style>
"""))
In [ ]:
In [3]:
gopro.network.scan()
Out[3]:
In [4]:
gopro.network.current_connection()
Out[4]:
In [8]:
ssid = 'GP26528824'
# ssid = 'GreenCanoe'
In [158]:
# ssid = 'GP26528824'
ssid = 'GreenCanoe'
In [10]:
gopro.network.connect_wifi(ssid)
In [4]:
wid = gopro.GoPro()
In [5]:
# wid.stop
In [6]:
gopro.commands.set_mode_video()
In [12]:
gopro.commands.shutter_capture()
In [13]:
gopro.commands.shutter_stop()
In [14]:
gopro.media.update_local_data(show_bar=True)
In [22]:
def current_mode():
raw_status, raw_settings = gopro.commands.get_raw_status_settings()
info_status = gopro.api.parse_status_names(raw_status)
mode, submode = gopro.api.parse_mode_sub_mode(info_status)
return mode
In [23]:
current_mode()
Out[23]:
In [26]:
gopro.media.get_data_urls()
Out[26]:
In [97]:
def work():
if current_mode() != 'photo':
gopro.commands.set_mode_photo()
files_old = gopro.media.local_data_files()
gopro.commands.shutter_capture()
gopro.media.update_local_data()
files_new = gopro.media.local_data_files()
assert(len(files_old) == len(files_new) + 1)
for f in files_new[::-1]:
if f not in files_old:
break
return f
# def status_line(gp, time_ref=0):
# tpl = ''
# t = gp.status.current_time_msec/1000 - time_ref
# b = gp.status.system_busy > 0
# n = gp.status.num_total_photos
# m = gp.status.num_total_videos
# msg = tpl.format()
In [96]:
gopro.get(gopro.commands.api.url_delete_all)
Out[96]:
In [137]:
In [139]:
files = gopro.media.local_data_files()
In [140]:
files[-10]
Out[140]:
In [172]:
In [173]:
d.shape
Out[173]:
In [ ]:
In [ ]:
In [ ]: