Giter VIP home page Giter VIP logo

dropcam's Introduction

Dropcam

RubyGem to access Dropcam account and Camera including direct live stream access

Code Climate

Installation

Add this line to your application's Gemfile:

gem 'dropcam'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dropcam

Usage

require 'dropcam'

dropcam = Dropcam::Dropcam.new("<USERNAME>","<PASSWORD>")
camera = dropcam.cameras.first

# returns jpg image data of the latest frame captured
screenshot = camera.screenshot.current

# write data to disk
File.open("#{camera.title}.jpg", 'w') {|f| f.write(screenshot) }

# access and modify settings
# this disables the watermark on your camera stream
settings = camera.settings
settings["watermark.enabled"].set(false)

Live Stream

Streaming isn't directly integrated currently and it's up to you to find a player. Some of the players available:

  • VLC (RTSP/RTMP)
  • RTMPDump (RTMP)
  • openRTSP (RTSP)

The easiest way to record the live camera stream is with RTMPDump. Install via homebrew:

`$ brew install rtmpdump`

To save a live stream:

require 'dropcam'
dropcam = Dropcam::Dropcam.new("<USERNAME>","<PASSWORD>")
camera = dropcam.cameras.first

# record the live stream for 30 seconds
camera.stream.save_live("#{camera.title}.flv", 30)

# to get access information to use a third party application
# RTMP/Flash Streaming
camera.stream.rtmp_details

# RTSP Streaming
camera.stream.rtsp_details

Currently stream resolution is limited to 400x240.

NOTES:

The Dropcam API is unofficial and unreleased. This code can break at anytime as Dropcam changes/updates their service.

This gem has only been tested on Mac OS 10.8 running Ruby 1.9.3

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

dropcam's People

Contributors

justinledwards avatar nolanbrown avatar radekw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dropcam's Issues

Camera Not Found (Dropcam::CameraNotFoundError)

Few days ago I noticed the library stopped working and fails with the following error on login.

irb(main):001:0> require 'dropcam'
=> true
irb(main):002:0> dropcam = Dropcam::Dropcam.new("", "")
Dropcam::CameraNotFoundError: Camera Not Found
    from /Library/Ruby/Gems/2.0.0/gems/dropcam-0.0.4/lib/dropcam/base.rb:108:in `get'
    from /Library/Ruby/Gems/2.0.0/gems/dropcam-0.0.4/lib/dropcam/session.rb:37:in `_session_token'
    from /Library/Ruby/Gems/2.0.0/gems/dropcam-0.0.4/lib/dropcam/session.rb:26:in `authenticate'
    from /Library/Ruby/Gems/2.0.0/gems/dropcam-0.0.4/lib/dropcam.rb:11:in `initialize'
    from (irb):2:in `new'
    from (irb):2
    from /usr/bin/irb:12:in `<main>'

RTSP Streaming

Is anyone having success streaming RTSP?

I have tried streaming a publicly available camera to my VLC player:

rtsp://user:[email protected]:554/be6db485223a41ee8c25ba468c056f8e

NameError: uninitialized constant Dropcam::Base::OpenSSL

Wanted to get started using this to be able to turn my dropcam ON / OFF at certain times of the day.

When I go through the settings example in irb I get the following error after I run

Dropcam::Dropcam.new("USERNAME","PASSWORD")
NameError: uninitialized constant Dropcam::Base::OpenSSL

Is there another required gem that I am missing?

camera.settings["watermark.enabled"].set(false) not working

# Disable watermark
settings = camera.settings
settings["watermark.enabled"].set(false)

The above, as written in the documentation, seems to not actually be changing the watermark to a disabled status and I'm still getting it on snapshots. I'm wondering if Dropcam changed the value of the parameter name or has disabled removing it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.