Comments (10)
Thanks for the info. I have an Android I can use to replicate this and get it fixed (hopefully).
from onvif-nvt.
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.
@atirage Yes, it should probably detect if it is an object or an array. Can you PR the code?
from onvif-nvt.
Will release soon
from onvif-nvt.
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.
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.
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.
@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.
@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.
Forgot to close after releasing, so closing now
from onvif-nvt.
Related Issues (20)
- npm install onvif-nvt gives error message HOT 1
- An in-range update of eslint-plugin-jsdoc is breaking the build 🚨 HOT 2
- npm install results in "Appears to be a git repo or submodule." HOT 1
- Can not filtering events
- Hardcoded parameter values in pullMessages events implementation HOT 1
- An in-range update of eslint-plugin-jest is breaking the build 🚨 HOT 1
- An in-range update of eslint-plugin-jest is breaking the build 🚨 HOT 8
- An in-range update of eslint-plugin-node is breaking the build 🚨 HOT 1
- Unauthorized when trying to pull events HOT 3
- An in-range update of eslint-plugin-jest is breaking the build 🚨 HOT 39
- pretty-data v0.40.0 needs to be updated to v0.50.0 HOT 1
- Something seems not right HOT 2
- circle-ci error: node version needs to upgraded from 9.4.0 since jest need minimum node v10.13.0 HOT 2
- Does this lib support Two-Way Audio? HOT 2
- The security token could not be authenticated or authorized HOT 6
- Update hardware lookup. HOT 1
- Is there a way to set the current time? HOT 1
- Can i control camera infrared settings in onvif?
- Can i use https?
- Event messages:error: SubscribeCreationFailedFault HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onvif-nvt.