Closed jwilsoab closed 2 years ago
Wow. This is surprise for me. @RogerHardiman
Did some checking so need more info from Adam, @jwilsoab
getVideoSourceOptions is not an ONVIF API that I can find in the ONVIF spec (or WSDL) I've checked Media API, Media2 API and Imaging APIs
If the request is to get the ranges of values for Image Sizes, there is an ONVIF API with a slightly different name of getVideoSourceConfigurationOptions in the Media API. But this library has never implemented it. There is another NodeJS ONVIF Library on github that supports it (so their README says).
If the request is to get the range of values for Brightness settings (the ONVIF Imaging API) then the ONVIF command is getOptions in the Imaging API.
So need more info from Adam to get more detail.
Thanks Roger
This library has never implemented that command. I know another common Javascript/Node JS ONVIF library does support it.
The range of options for Imaging is not getVideoSourceOptions. It is Imaging API and GetImageSettings
Hmm, maybe it was added after being pulled. Here's the method I'm talking about:
/**
* Get the video source options for a given video source
* @param {Object} options.token videoSourceToken
* @param {function} [callback]
*/
Cam.prototype.getVideoSourceOptions = function(options, callback) {
if ( !(options && options.token && callback) ) {
callback.call(this, 'Invalid arguments given to getVideoSourceOptions');
return;
}
this._request({
service: 'imaging'
, body: this._envelopeHeader() +
`<GetOptions xmlns="http://www.onvif.org/ver20/imaging/wsdl">
<VideoSourceToken>${options.token}</VideoSourceToken>
</GetOptions>` +
this._envelopeFooter()
}, function(err, data, xml) {
if (callback) {
let jsonData = linerase(data),
respData = {};
if (jsonData && jsonData.getOptionsResponse && jsonData.getOptionsResponse.imagingOptions) {
respData = jsonData.getOptionsResponse.imagingOptions;
}
// Empty response on success
callback.call(this, err, respData, xml);
}
}.bind(this));
};
Sorry, this is jwilsoab using a different acct
That was fast. Thanks. I'm checking the source now.
There is something weird here. Could you attach here the whole source file that this function came from please and do you know where you got that source from. I am wondering if it was from a fork of the source code.
It just seems odd that we'd have a function called getVideoSourceOptions when the actual ONVIF API is getOptions. Normally the function name matches up with the ONVIF API action.
Also, could you send the package.json file. That contains the library version too.
Thanks for your help
This chat only supports txt files in chat..., but these are the files we had previously
hanks for the files. I've checked all the historical versions of imaging.js and the GetOptions function has never been in the Master (release) branch. I wonder where you got that source from. Maybe someone else's fork or another project that uses the library. Anyway, let's get it added.
REQUEST Normally when we add new functions to the library when also include test code in the 'test' folder and put in a simulated ONVIF reply in the test/serverMockup.
I wonder if whoever wrote getVideoSourceOptions also implemented the ServerMockup tests. Could you navigate to the tests/serverMockup folder in your old ONVIF library and do an 'ls' for me please. Then I can see if whoever added getVideoSourceOptions added an implementation of imaging.GetOptions
That would save us a load of work mocking up and testing the function.
Thanks Roger
I have grabbed the XML reply for GetOptions and added it to the test/serverMockup and added in a test to coffeescript. But, my test is failing so cannot push the changes this evening. Will have another stab at it in a day or two.
Roger
@jwilsoab @armlesswunder , could you check out the Master branch of the library please and check this works for you. I've taken the code you sent over and included it in the ONVIF library along with unit test changes in the /test folder.
The API will be the same, but I made one change to do with how Options parameter is parsed to make it consistent with other functions and code changes.
Let me know if it works fine. I've tested it against a Bosch camera and get the JSON data structure back with the max and min and included it in the test scripts.
Roger
@RogerHardiman yes that works for me. Thanks again for your help!
That is great. Thanks for the report.
Are you able to share anything about the project you are working on, always nice to hear how the library is used.
@RogerHardiman Yes, I work for a VMS solution called Cloudvue. https://www.cloudvue.io/
I write camera integration scripts using Node.js and I also do mobile development of Cloudvue and Cloudvue Access apps.
We support many ONVIF Profile S Cameras with help from this repo to do things like RTSP streaming, PTZ controls, modify imaging settings, OSD settings, Scan for ONVIF devices, etc...
I really appreciate this repo. Thanks for everything!
Thanks for the feedback on the library uses. That's really interesting.
Also you mentioned Profile S.
In Release 0.6.5 I added some of the bits of Profile T. Now we can get the RTSPStreamURIs for the H265 streams off Bosch and HikVision cameras. (Back with the Profile S APIs, most cameras only advertised their MJPEG/MPEG4/H264 streams [as 265 was not a valid Profile S codec]. I'm using that on a project with new Bosch cameras and can get the H265 stream URIs back now.
Is there any reason Cam.getVideoSourceOptions was removed? (Imaging) How does one go about getting range of values for imaging options now?