Skip to content

Instantly share code, notes, and snippets.

View KonradIT's full-sized avatar

Konrad Iturbe KonradIT

View GitHub Profile
@KonradIT
KonradIT / autoexec.ash
Created December 31, 2013 20:21
autoexec.ash
sleep 1
t app appmode photo
sleep 1
t app button shutter PR
sleep 1
t app button power PR
sleep 3
t app button power PR
@KonradIT
KonradIT / goprohero.py
Last active January 3, 2016 04:19 — forked from cooncesean/gopro.py
class GoProInterface(object):
"""
This is a sample API (written in Python) of how I envision
the calls to be made to the firmware.
Sample (Python) Usage:
>>> gpi = GoProInterface('~/gopro/videos/')
>>> gpi.start()
>>> gpi.stop()
/Users/sean/gopro/videos/0001.m4v
"""
This program interfaces with the GoPro camera and records footage for a
set amount period of time defined by the optional `--seconds` arg.
"""
import argparse
import time
import serial
parser = argparse.ArgumentParser(description='Captures video from GoPro for set number of seconds.')
parser.add_argument(
pi@raspberrypi ~/public_html/gopro $ cat take_picture_and_send.sh
#!/bin/bash
## volume 100%
curl "http://10.5.5.9/camera/BS?t=goprohero&p=%02"
sleep 1
## mode to photo
curl "http://10.5.5.9/camera/CM?t=goprohero&p=%01"
sleep 1
## take picture
curl "http://10.5.5.9/bacpac/SH?t=goprohero&p=%01"
# Sort pictures from GOPRO09* in img (symbolic links)
x=1;for i in GOPRO9*JPG; do counter=$(printf %04d $x); ln "$i" img_in_order/img"$counter".jpg; x=$(($x+1)); done
# Rotate pictures if needed
for file in *.jpg; do convert $file -rotate 180 rotated-$file; done
# Make a 24img/s movie
ffmpeg -i "img%04d.jpg" -r 24 -s hd720 -vcodec libx264 -b:v 4000k fflapse_hd720.mp4
class GoproClient
attr_reader :ip_address
attr_reader :password
attr_reader :delay
def initialize(ip_address, password, delay = 1.0)
@ip_address = ip_address
@password = password
@delay = delay
end
@KonradIT
KonradIT / gopro.py
Last active January 3, 2016 16:19
gopro hero
import time
time.sleep(4)
urrlib2.urlopen("http://10.5.5.9/camera/PW?t=PASSWORD&t=%01")
@KonradIT
KonradIT / GPBrowser.html
Last active January 3, 2016 16:19
GPBrowser, a html file that displays all the files shot in a gopro via wifi, and it autorefresh every X seconds. Replace X by the seconds the browser have to refresh the page. Replace XXX by the number of the folder you want to browse
<html>
<!GPBrowser, a html file that displays all the files shot in a gopro via wifi, and it autorefresh every X seconds.>
<head><!Replace X by the seconds the browser have to refresh the page.>
<meta http-equiv="refresh" content="X">
</head>
<frameset ROWS="100%, *" frameborder="no" framespacing="0" border="0">
<!Replace XXX by the number of the folder you want to browse>
<frame SRC="http://10.5.5.9:8080/videos/DCIM/XXXGOPRO" NAME="mainwindow" frameborder="no" framespacing="0" marginheight="0" marginwidth="0">
</frameset>
<noframes>
@KonradIT
KonradIT / PreviewAndRecord.html
Created January 18, 2014 13:33
You'll have a preview of the GoPro camera, and when X secs are passed, the GoPro will start recording. Set your gopro to video mode!
<!DOCTYPE html>
<html>
<head>
<!-Change password by the gopro wifi password!, and change X by the seconds the camera have to wait until it starts recording ->
<META HTTP-EQUIV="refresh" CONTENT="X; URL=http://10.5.5.9/bacpac/SH?t=password&p=%01">
</head>
<body>
<p>gopro.html by Konrad Iturbe (github: @konradit)</p>
<div style="text-align:center">
<button onclick="playPause()">Play/Pause</button>
from __future__ import absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement
import urllib2
from bs4 import BeautifulSoup
import urlparse
import shutil
import re, os
base_url = "http://10.5.5.9:8080/videos/DCIM/XXXGOPRO/" #Where XXX, change it by the directory you want (for instance 100GOPRO)
content = urllib2.urlopen(base_url).read()