Onvif Support
Okay, i'm getting the feeling seyxd died by covid or vax since don't see activity/replies.. here is the deal

Most cameras if not all except some old i expecting to support ONVIF, onvif is really usefull because i didn't knew what the rtsp url is to put the cameras on the app, it toke me a while to figure out what is going on. with onvif we can detect all the cameras in the network and automatically grab A. a live url for snapshot, B. stream A and low B, and C. motion detect proccessed by camera.

To do this i used two packages. 

import onvif from 'node-onvif';  <- for discovery of streaming urls, camera names, etc.
import onvifEvents  from 'node-onvif-events';   <- for motion detection provided by the camera it self.

Note: node-onvif-events had to be manually installed as npm produced some errors when installing.

The following two functions return an array of objects, each object has these info.  ob.snapshot is the url for a live fresh snapshot jpeg image, rtsp is an array of profiles, with urls for streaming note that to pass that info on ffmpeg you will need to replace :// with ://user:password@url  

eg. rtsp://192.168.7.25:8554/profile0 needs to be http://user:pass@192.168.7.25:8554/profile0 


`[
  {
    snapshot: 'http://192.168.7.25:6688/snapshot/PROFILE_001',
    rtsp: [
      'rtsp://192.168.7.25:8554/profile0',
      'rtsp://192.168.7.25:8554/profile1'
    ],
    urn: 'urn:uuid:2171bb3f-aa30-aa30-3030-e062905c7634',
    name: 'HD%20IPC',
    xaddr: 'http://192.168.7.25:6688/onvif/device_service'
  },
`



`async function   testme(username, password) {
  return new Promise(async (resolve, reject) => {
  let camojb = {};
  const cameras_info = [];
  console.log('Start the discovery process.');
  // Find the ONVIF network cameras.
  // It will take about 3 seconds.
 onvif.startProbe().then(async (device_info_list) => {
  for (let i=0; i<device_info_list.length; i++) {
    let info = device_info_list[i];
    let device = new onvif.OnvifDevice({
      xaddr: info.xaddrs[0],
      user : username,
      pass : password
    });
    camojb = await getURLs(device);
          //set obj
          camojb.urn = info.urn;
          camojb.name = info.name;
          camojb .xaddr = info.xaddrs[0];
 // Initialize the OnvifDevice object
       cameras_info.push(camojb);
  }
  resolve(cameras_info)
  }).catch((error) => {
    console.error(error);
  })
})
}

async function getURLs(device) {
  return new Promise(async function(resolve) { 
  let camojb = {};
  camojb.snapshot = [];
  camojb.rtsp = [];
  device.init().then(() => {
 
    let profile_list =   device.getProfileList();
   
    for(let i=0; i<profile_list.length; i++) {
      camojb.snapshot = profile_list[i].snapshot;
      camojb.rtsp[i] = profile_list[i].stream.rtsp;
    }  
  }).then(() => {
    resolve(camojb)
 
  }).catch((error) => {
    console.error(error);
  });
});
}`

Now as for motion detection:

 `const startMotion = async () => {
  const detector = await onvifEvents.MotionDetector.create(options.id, options);
  console.log(new Date(), '>> Motion Detection Listening!!');
  detector.listen((motion) => {
    if (motion) {
      console.log(new Date(), '>> Motion Detected');
    } else {
      console.log(new Date(), '>> Motion Stopped');
    }
  });
}

startMotion();`


tested both packages inside camera.ui as console.prints and works wonders.. now we need to impelement those into the app. 
a second feature that i find very important is to use .mkv for filenames and -copy for codecs, as almost all cameras provide already codec video and ffmpeg by default decodes video with mp4 or other extions in filename despite if you are u trying to use -codec copy, codec copy is only accepted on mkv.
