Ionic - onvif

Has someone worked on it?
I want to make it work on android and ios. Where should I find some good materials to discover how it works? (I found only

What is it?

ONVIF is an open industry forum that provides and promotes standardized interfaces
for effective interoperability of IP-based physical security products.

sounds not very relevant…

Ok. I’m introducing my problem.
I need to make an app which can provide the image stream (mostly it’s by rtsp). But making just only putting stream in text form like ( - it’s ridiculous way.
I want to make the possibility to scan local web and somehow later controlling the ONVIF camera but from for example mobile web (not only local way).

I’ve never heard of this ONVIF before, but perhaps you might be interested in ionic-native/zeroconf.

Yup, I’m very familiar with ONVIF. If you are asking about how ONVIF works, there is a spec, and there is reality. Many cameras do their own thing and its a mess. If you are asking if there are implementations you can use, the closest I can think of is for something to start on. There are also C++ libs you can choose to compile and write a cordova wrapper around.

If I want to do it on my own what you recommend? (I mean what spec or anything else?)

This really isn’t a site for ONVIF questions. Start with the core specs.

(Feel free to discuss everything that is slightly related to using this “onvif” stuff in Ionic here though.)

@AceBoy Did you make it? I’m sitting over a similar requirement.

Unfortunately not :frowning:

Cool! Working on it. Will keep you posted.

I’ve made some huge progress here! Let me know if you’re interested to know.

Still interested in :slight_smile:

Please share your code.I am working on implementing live streaming of onvif camera.
Please provide some pointers on how to code on CLICK TO CONNECT Button?

Aceboy +, Sorry for the delayed response. Here’s a brief note about it:

  • Install the onvif package through npm.
  • Comment the following line of code from node_modules/onvif/lib/onvif.js. Otherwise, an error will be thrown as the dgram module won’t work in browsers.

// require(’./discovery’).Discovery

  • Import the onvif module wherever needed

import { Cam } from ‘onvif’;

  • Here’s a sample code to initialise the cam as per the onvif documentation => {
console.log(“inside platform ready!”);
new Cam({
hostname: CAM_IP,
port: CAM_PORT,
username: CAM_USERNAME,
password: CAM_PASSWORD
}, function (err) {
if (err) return console.log(err);
this.absoluteMove({ x: 1, y: 1, zoom: 1 });
this.getStreamUri({ protocol: ‘RTSP’ }, function (err, stream) {
console.log(“window.plugins”, rtspVideo);, function () {
console.log(‘Done Playing.’);
}, function (e) {
console.error('Error: ’ + e);

  • You’re good to go now. Hope this helps!

Thank you so much for the reply. Appreciate it.
I am getting error in line rtspVideo. Play(screen. Uri, function () {…}

The error is’‘Cannot find name’rtspVideo’.

Please share pointers on how to solve this…

That’s just an example. rtspVideo is another third-party plugin which you need to import. Check the docs here

Hey Guys, Need some help in this. Anybody successfully able to run this ?

What port number should be used here ? http port or RTSP?

Any help is appreciated. Ready to pay some amount if you guys ready to help