agsh / onvif

ONVIF node.js implementation
http://agsh.github.io/onvif/
MIT License
692 stars 234 forks source link

Review of Profile T and Media2 API changes requested #187

Closed RogerHardiman closed 3 years ago

RogerHardiman commented 3 years ago

Hi @agsh and @chriswiggins I've got some new ONVIF Cameras that use Profile T and H265. I've added support and just wanted you to have a quick check before I merge to master.

The two important changes in ONVIF are You must use GetServices() to get the XAddrs and not GetCapabilities. This lets us check if the Media XAddr is 'media10' or 'media20' (Media Version 1.0 or Media Version 2.0).

The for GetProfiles() I have to use the old Media XML format and XML namespace or the new Media2 XML format and namespace. This lets me get a list of Profiles where the Encoder can be H265. The reply for Media2 GetProfiles() is in a slightly different format (different XML tag names) but I modify the result so the reults are in the same format as the old media10 GetProfiles. This means the 'activeProfile' and uses of cam_obj.Profiles do not need to make any changes to support Profile T and H265.

I have not made a change to Mock Server yet to reply with Media2. But I've tested it on two HikVision cameras in the office and will test with some new Bosch cameras with H265 on a customer site next week.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-2.6%) to 85.127% when pulling 7dc52c9d95ca32e5fd0065ecd5b5216189d0fcf8 on roger into 67976400e4ecb7e3336f0287d1d4b174171ab344 on master.

RogerHardiman commented 3 years ago

Just tested with a demo camera from Lilin over. Profile T / H265 worked fine.

RogerHardiman commented 3 years ago

GetStreamUri, GetProfiles and GetSnapshotURI are common to Media1 and Media2. The low level XML differs but they do the same things But the rest of Media2 is very different - the list of Audio and Video Sources, list of Audio and Video Encoders. So now I am wondering if we want to have GetStreamUri2(), GetProfiles2() and GetSnapshotUri2() and have different functions. End users will need to decide if they use GetProfiles or GetProfiles2 based on lib.media2Supported that Jessey added.

Any thoughts?