Coder Social home page Coder Social logo

onvif-camera-api's Introduction

onvif-camera-api

This is an API to control IP cameras using the ONVIF specification. The API server code passes parameters to onvif.jar to select and control a camera.

Tested on: Python 2.7.6, Flask 0.10.1, Java 1.7.0_25

onvif library based on: https://github.com/milg0/onvif-java-lib

Camera Control Options:
  • Pan
  • Tilt
  • Zoom

Example calls:

View All Presets:

method: GET

url/v1/camera/ptz/preset

curl -H "Content-Type: application/json" -X GET http://127.0.0.1:8888/v1/camera/ptz/preset

View a Selected Preset via ID:

method: GET

url/v1/camera/ptz/preset/preset_id

curl -H "Content-Type: application/json" -X GET http://127.0.0.1:8888/v1/camera/ptz/preset/1

Move Selected Camera via Preset ID:

method: POST

url/v1/camera/ptz/preset/preset_id

curl -H "Content-Type: application/json" -X POST -d '{"username":"myUsername","password":"myPwd"}' http://127.0.0.1:8888/v1/camera/ptz/preset/4

Move Selected Camera:

method: POST

url/v1/camera/ptz/

curl -H "Content-Type: application/json" -X POST -d '{"url":"0.0.0.0","username":"myUsername","password":"myPwd","pan":"-1.0","tilt":"-1.0","zoom":"2.0"}' http://127.0.0.1:8888/v1/camera/ptz

Create Preset:

method: POST

url/v1/camera/ptz/preset/create

curl -H "Content-Type: application/json" -X POST -d '{"url":"0.0.0.0","pan":"-1.0","tilt":"1.0","zoom":"2.0"}' http://127.0.0.1:8888/v1/camera/ptz/preset/create

Example JSON Output:

Moving Camera:

{
  "status_code": "ok",
  "status_message": [
    "x -1.0  y -1.0  zoom 2.0",
    "Move completed."
  ]
}

Viewing All Presets:

{
  "settings": [
    {
      "id": 1,
      "pan": "0.0",
      "tilt": "0.0",
      "url": "0.0.0.0",
      "zoom": "0.0"
    },
    {
      "id": 2,
      "pan": "0.0",
      "tilt": "0.0",
      "url": "10.10.10.10",
      "zoom": "0.0"
    },
    {
      "id": 3,
      "pan": "0.0",
      "tilt": "0.0",
      "url": "192.168.1.1",
      "zoom": "0.0"
    }
  ],
  "status_code": "ok"
}

Selecting/Viewing a Single Preset:

{
  "settings": {
    "id": 1,
    "pan": "0.0",
    "tilt": "0.0",
    "url": "0.0.0.0",
    "zoom": "0.0"
  },
  "status_code": "ok"
}

onvif-camera-api's People

Contributors

kphongagsorn avatar

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.