Repository is archived
No commit activity in last 3 years
No release in over 3 years
Provides a wrapper around to API for cameras that support the Sony [Camera Remote API](http://developer.sony.com/develop/cameras/).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
~> 2.8.0
~> 1.17.1

Runtime

 Project Readme

SonyCameraRemote

Build Status

Provides a Ruby wrapper around the API for cameras that support the Sony Camera Remote API.

Installation

Add this line to your application's Gemfile:

gem 'sony-camera-remote'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sony-camera-remote

Usage

require 'sony_camera_remote'

# Discover cameras and their services using UPnP
Discovery::Client.new.discover
# => ['http://10.0.0.1:10000/sony/camera']

cam = Camera.new('http://10.0.0.1:10000/sony/camera')
img_uri = cam.shoot
# => http://10.0.0.1:60152/pict140119_1923230000.JPG?%211234%21http%2dget%3a%2a%3aimage%2fjpeg%3a%2a%21%21%21%21%21

Command-line client

# Assuming that the camera is in photo mode
$ sonycam shoot
http://10.0.0.1:60152/pict140119_1923230000.JPG?%211234%21http%2dget%3a%2a%3aimage%2fjpeg%3a%2a%21%21%21%21%21

# Shoot and open browser with the returned image URL
$ open $(sonycam)     # Mac
$ xdg-open $(sonycam) # GNOME

Manually testing the Camera Remote API

# Discover devices using UPnP
bin/search-nex.py

# Fetch the endpoint URLs manually
curl http://10.0.0.1:64321/DmsRmtDesc.xml | xmllint --format -

# change mode to still
curl -v -X POST -H "Content-Type: application/json" -d '{"method":"setShootMode", "params":["still"], "id":1, "version":"1.0"}' http://10.0.0.1:10000/sony/camera

# take a picture manually
curl -v -X POST -H "Content-Type: application/json" -d '{"method":"actTakePicture", "params":[], "id":1, "version":"1.0"}' http://10.0.0.1:10000/sony/camera