Code Monkey home page Code Monkey logo

Comments (10)

hawkeye64 avatar hawkeye64 commented on June 19, 2024 7

Thanks for the info. I have an Android I can use to replicate this and get it fixed (hopefully).

from onvif-nvt.

atirage avatar atirage commented on June 19, 2024 1

I've added some extra logging, this is what your parseProfiles gets as argument:
{ '$': { token: 'profile_token',
'xmlns:tt': 'http://www.onvif.org/ver10/schema' },
Name: 'CurrentProfile',
VideoSourceConfiguration:
{ '$': { token: 'video_src_config_token' },
Name: 'Primary Source',
UseCount: '0',
SourceToken: 'video_src_token',
Bounds: { '$': [Object] } },

VideoEncoderConfiguration:
{ '$': { token: 'encoder_config_token' },
Name: 'PiCameraConfiguration',
UseCount: '0',
Encoding: 'H264',
Resolution: { Width: '1280', Height: '720' },
Quality: '1',
RateControl:
{ FrameRateLimit: '25',
EncodingInterval: '1',
BitrateLimit: '10000' },
H264: { GovLength: '60', H264Profile: 'High' },
Multicast: { Address: [Object], Port: '0', TTL: '1', AutoStart: 'false' },
SessionTimeout: 'PT1000S' },

PTZConfiguration:
{ '$': { token: 'ptz_config_token_0' },
Name: 'PTZ Configuration',
UseCount: '1',
NodeToken: 'ptz_node_token_0',
DefaultAbsolutePantTiltPositionSpace: 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
DefaultAbsoluteZoomPositionSpace: 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
DefaultRelativePanTiltTranslationSpace: 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
DefaultRelativeZoomTranslationSpace: 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
DefaultContinuousPanTiltVelocitySpace: 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
DefaultContinuousZoomVelocitySpace: 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
DefaultPTZSpeed: { PanTilt: [Object], Zoom: [Object] },
DefaultPTZTimeout: 'PT5S' }
}

from onvif-nvt.

hawkeye64 avatar hawkeye64 commented on June 19, 2024 1

@atirage Yes, it should probably detect if it is an object or an array. Can you PR the code?

from onvif-nvt.

hawkeye64 avatar hawkeye64 commented on June 19, 2024 1

Will release soon

from onvif-nvt.

hawkeye64 avatar hawkeye64 commented on June 19, 2024

Sounds like the Camera doesn't have profiles. Are you sure the camera is ONVIF compliant? If so, does it just have one profile that is not kept in an array?
Ok, I'll have to look into rpos and see if they are doing it right.

from onvif-nvt.

mijapa avatar mijapa commented on June 19, 2024

I have similar error using the Mozilla IoT Gateway and the camera I'm using is Android phone camera made ONVIF compatible using IP Webcam https://play.google.com/store/apps/details?id=com.pas.webcam

ERROR : onvif: TypeError: Cannot read property 'forEach' of undefined
ERROR : onvif: at core.getScopes.then.results (/home/mp/.mozilla-iot/addons/onvif-adapter/node_modules/onvif-nvt/lib/camera.js:562:18)
ERROR : onvif: at
ERROR : onvif: at process._tickCallback (internal/process/next_tick.js:189:7)
ERROR : onvif: TypeError: Cannot read property 'forEach' of undefined
ERROR : onvif: at core.getScopes.then.results (/home/mp/.mozilla-iot/addons/onvif-adapter/node_modules/onvif-nvt/lib/camera.js:562:18)
ERROR : onvif: at
ERROR : onvif: at process._tickCallback (internal/process/next_tick.js:189:7)
ERROR : onvif: Failed to initialize device at undefined: TypeError: Cannot read property 'forEach' of undefined

from onvif-nvt.

atirage avatar atirage commented on June 19, 2024

Any update on this? I'm no js expert, but to me this looks like a type mismatch: rpos provides an object, nvt expects an array.

from onvif-nvt.

hawkeye64 avatar hawkeye64 commented on June 19, 2024

@atirage Sorry, have not had time. I apologize that this project is low on my list. We use it at work, but all of our cameras work with it. PRs are very welcomed if you feel you can help out. The problem with working with hardware is if you don't have the specific hardware, then you can only hope something works. This can cause several iterations with those that do have the hardware. Therefore, it's easier for those with the hardware do the specific work needed. Again, my apologies. Please feel free to work through it and make adjustments as needed. I also just want to point out, that having done this project, I have found the ONVIF specs to be lenient on design and different camera manufacturers implement in different ways, unfortunately. If you make changes, be sure to keep compatibility with those cameras that currently do work. ie: test returned object as js array or js object.. Thanks.

from onvif-nvt.

atirage avatar atirage commented on June 19, 2024

@hawkeye64, no worries, I was just wondering if it was still on your radar or not. :)
I managed to fix it by adding the following code snippet in function parseProfiles:

if (!Array.isArray(profiles)) {
      var prof_arr = [];
      prof_arr[0] = profiles;
      profiles = prof_arr;
    }

I'm not sure if this is generic enough, but it seems that the issue will happen only if there's just one profile.

from onvif-nvt.

hawkeye64 avatar hawkeye64 commented on June 19, 2024

Forgot to close after releasing, so closing now

from onvif-nvt.

Related Issues (20)

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.