Giter VIP home page Giter VIP logo

ptz-server's Introduction

PTZ-SERVER

PTZ-SERVER is a full PTZ server to control VISCA-IP and VISCA-Serial cameras using a web interface and HID devices like joysticks and gamepads.

Eventually, it will enable users to program advanced camera moves as macros.

Rationale...

Of course, the main reason for this module is to fully implement the VISCA protocol without any reliance on libvisca the main C library for VISCA commands.

I did it as a challenge to myself, but also so that the VISCA protocol could be more easily understood by Javascript/Typescript developers who are not comfortable reading protocol documentation or C source code.

Finally, by implementing it in Typescript, I have been able to create a code-base that can be parsed easily by Visual Studio Code (and presumably other IDEs) providing intelligent code suggestions to make calling VISCA commands much easier on the developer.

The biggest challenge for the Javascript/Typescript ecosystem in managing Visca connections is that Visca commands are intended to be executed in the following manner:

  • send a command over the serial or network connection
  • wait for an ACK (for most commands)
  • wait for a DONE (for many commands)

Javascript doesn't like to work this way. Javascript/Typescript code wants everything to run asynchronously, so this library virtualizes VISCA cameras to maintain command buffers and callbacks. As VISCA commands come in, the Camera objects will update themselves and then emit an 'update' event. As a developer, you only need to send commands and listen for changes on the various objects.

ptz-server's People

Contributors

jeffmikels avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ptz-server's Issues

[REQ] add a (GH-compliant) license file

Hi there, 1st of all thanks for this cool work !

Since we've "doxed" it in our HyMPS project (under the VIDEO category \ Pan Tilt Zoom page \ Generic subsection), can you please add the license to it ?

As you know, expliciting licensing terms is extremely important to let anyone better/faster understand how to reuse/adapt/modify sources (and not only) in other open projects and vice-versa.

Although it may sounds like a minor aspect, license file omission obviously causes an inconsistent generation of the relative badge too:


(badge-generator URL: https://flat.badgen.net/github/license/jeffmikels/ptz-server/?label=LICENSE)

Anyway you can easily set a standardized one through the GH's license wizard tool.

Last but not least, let us know how - in your opinion - we could improve our categorizations and links to resources in order to favor collaboration between developers (and therefore evolution) of listed projects.

Thanks in advance.

I try to make it work

Hello and thank you for this repo.

I don't know much about nodejs, I'm trying to set up a visca over IP camera but I get this error message:

ptz-server-main/dist/config.js:19
    viscaIPCameras: [192.168.0.110:52381],
                            ^^

SyntaxError: Unexpected number
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/maxime/Téléchargements/ptz-server-main/dist/app.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

How to make it work?

npm envroment

What version is good for running ptz-server?

Almostry npm run build says...

for (let i = startIndex ?? 0; i < array.length; i++) {


ubuntu@vaio0001:~/git/ptz-server$ nvm ls
v8.17.0
v10.24.1
v12.22.12
v14.21.3
v16.20.2
-> v20.12.0
system
default -> 14 (-> v14.21.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v20.12.0) (default)
stable -> 20.12 (-> v20.12.0) (default)
lts/* -> lts/iron (-> v20.12.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0
lts/dubnium -> v10.24.1
lts/erbium -> v12.22.12
lts/fermium -> v14.21.3
lts/gallium -> v16.20.2
lts/hydrogen -> v18.20.0 (-> N/A)
lts/iron -> v20.12.0

How does this work please?

Is this working?

I was looking to use this to figure out how the underlying visca library works.

However, from examining the code, I do not see how the controllers are hooked up to the visca code.

Is there not some mechanism like callback or update that needs to be hooked up in app to map the button presses / joystick movements to trigger visca commands?

I also do not understand how the httpHandler responds to and controls the visca ptz.

Am I missing something?

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.