Giter VIP home page Giter VIP logo

gsoap-onvif's Introduction

Gsoap-Onvif

This repository used gsoap onvif to get images, go to presets and move. It can run in jetson nano 2g version and test on the hikCamera. This repository do the secondary wrap for ssig-onvif, and give a specific instruction to use it.

Step1. Install Ssig-Onvif
  1. Install opnessl
# download openssl from web 
wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2l.tar.gz
tar -xzvf openssl-1.0.2l.tar.gz
cd openssl-1.0.2l
sudo ./config
sudo make 
sudo make test # you can test it with this line 
sudo make install 
# check openssl version
openssl version
  1. Install libssl1.0
sudo apt-get install libssl1.0-dev
Step2. Build Project Next step is build the project, you should remove the files in build fold,and the rebuild the project by the following lines.
cd gsoap-onvif
cd build 
rm -rf *
cmake ..
make -j 
./zoom_tea

Deployment

From now, gsoap-onvif achieve the functions about absolute move, relative move, goto preset, get preset, get ptz configuration, get meida configuration, get device configuration, stop, zoom in and zoom out. You can use it control the camera and take photos with opencv. The specific test code is in here.

make

cd {project_path}/factory/build
cmake ..
make

You can run the test code to test whether gsoap-onvif can run well on your computer.

Init

You can use the following codes to init the PTZ and Media, to control the camera use ptz and get camera settings by media.

#include <chrono>
#include <iostream>
#include <sstream> 
#include "glog/logging.h"
#include "OnvifClientDevice.hpp"
#include "OnvifClientPTZ.hpp"
#include "OnvifClientMedia.hpp"
std::string url = "192.168.66.64";
std::string name = "admin";
std::string password = "wst123456";
OnvifClientPTZ *PTZ = new OnvifClientPTZ(url, name, password, true);
OnvifClientMedia *Media = new OnvifClientMedia(url, name, password, true);

Get configuration

You can get the Meida configuration

std::vector<_ocp_Profile> get_profilesResponse;
Media->getProfiles(get_profilesResponse);

Goto preset

gotoPreset : the first parm can get from Media->getProfiles. The secondd parm is your setting preset like 1,2,3, type as int. The third parm is speed, between 0 to 1.0, type as float.

PTZ->gotoPreset(get_profilesResponse[0].profileToken,3,0.5);

Absolute move and Relative move

You can control the camera to move.

PTZ->relativeMove(get_profilesResponse[0], 0.0, 0.0, 0.0, 0.0, 0.5, 1);
PTZ->absoluteMove(get_profilesResponse[0], 0.0, 0.0, 0.0, 0.0, 0.5, 1);

gsoap-onvif's People

Contributors

richardomrmu avatar

Stargazers

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

Watchers

 avatar  avatar

gsoap-onvif's Issues

Failure in Make progress in Step 2

When I tried to build the project as directed, it reaches approximately 57% on the terminal before I get errors that prevent completion of the build. I've attached a text document that has the terminal entries for the build.

Terminal Errors.txt

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.