Skip to content

Commit

Permalink
General fixes, fixed typos, adds Spherical Download for GoPro Fusion …
Browse files Browse the repository at this point in the history
…cameras
  • Loading branch information
KonradIT committed Dec 27, 2017
1 parent f609eb6 commit beca34a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion goprocam/GoProCamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def sendCamera(self, param,value=""):

def sendBacpac(self, param,value):
#sends parameter and value to /bacpac/
value_notemtpy = ""
value_notempty = ""
if value:
value_notempty=str('&p=%' + value)
try:
Expand Down Expand Up @@ -756,6 +756,16 @@ def getPhotoInfo(self, option= "", file = "", folder= ""):
data=urllib.request.urlopen('http://10.5.5.9:8080/gp/gpMediaMetadata?p=' + folder + "/" + file + '&t=v4info').read().decode('utf-8')
jsondata=json.loads(data)
return jsondata[option] #"w":"4000","h":"3000" / "wdr":"0","raw":"0"
def downloadLastSpherical(self):
if self.IsRecording() == 0:
print("filename: " + self.getMediaInfo("file") + "\nsize: " + self.getMediaInfo("size"))
urllib.request.urlretrieve(self.getMedia(), self.getMediaInfo("folder")+"-"+self.getMediaInfo("file"))
if self.getMediaInfo("folder").endswith("BACK"): #last folder is ###GBACK
urllib.request.urlretrieve(self.getMedia().replace("BACK","FRNT"), self.getMediaInfo("folder").replace("BACK","FRNT")+"-"+self.getMediaInfo("file"))
else:
urllib.request.urlretrieve(self.getMedia().replace("FRNT","BACK"), self.getMediaInfo("folder").replace("FRNT","BACK")+"-"+self.getMediaInfo("file"))
else:
print("Not supported while recording or processing media.")
def getClip(self, file, resolution, frame_rate, start_ms, stop_ms):
out = self.gpControlCommand("transcode/request?source=DCIM/" + file + "&res=" + resolution + "&fps_divisor=" + frame_rate + "&in_ms=" + start_ms + "&out_ms=" + stop_ms)
video_id = json.loads(out.replace("\\","/"))
Expand Down

0 comments on commit beca34a

Please sign in to comment.