This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This tool extracts the sections of a supplied GoPro | |
* firmware image. | |
* | |
* It creates the following files in the current directory: | |
* bst.bin, bld.bin, pri.bin, rom.bin, dsp.bin | |
* | |
* It also shows the expected CRC32 checksum of the section and shows | |
* where it will be written on the device, you can use this address as | |
* ROM address and load address in IDA Pro. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/opencv.hpp> | |
int main() | |
{ | |
cv::VideoCapture cap( "http://10.5.5.9:8080/live/amba.m3u8" ); | |
cv::namedWindow( "GoPro" ); | |
cv::Mat frame; | |
do { | |
cap >> frame; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir=${1-.} | |
fps=${2-48} | |
if [ ! -s times.sub ] | |
then | |
find . -path "*/$dir/???GOPRO/GOPR????.JPG" -printf '%p\n' | sort | python `dirname $0`/subs.py > times.sub | |
fi | |
mplayer "mf://$dir/???GOPRO/GOPR????.JPG" -mf w=1920:h=1080:fps=$fps:type=jpg -ao null -benchmark -vo yuv4mpeg:file=>(x264 --demuxer y4m --crf 21 --preset fast --muxer mkv --output GOPRO.MKV -) -vf scale=1920:-3,flip,mirror,crop=1920:1080:0:0,pp=al -sub times.sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Usage: gitio URL [CODE] | |
# | |
# Turns a github.com URL | |
# into a git.io URL | |
# | |
# Copies the git.io URL to your clipboard. | |
url = ARGV[0] | |
code = ARGV[1] |
OlderNewer