Types of motion



  • Hi, I would like to set up motion detection recording in shinobi, I have a Jienuo JN-IP501AR-B-WIFI (https://blog.sgalkin.info/2016/11/12/ccvt-jn-ip50-ar/) and I want to set it up in such a way that shinobi only records when camera detects motion. I want to avoid having shinobi "scanning" the camera all the time to see if there is motion because it will use a lot of traffic on my network.

    My camera has this options for motion detection

    0_1508855814248_motion1.PNG

    0_1508855830761_motion2.PNG

    0_1508855839426_motion3.PNG

    Is it useful for that? I also have shell access to the camera if some tricky scripts are needed 🙂


  • administrators

    If i understand correctly you want don't want shinobi to use the plugin to save traffic on your system?

    the plugin connects using localhost. That shouldn't affect other devices on the network.

    regardless if you would like to skip the plugin you can do it via a GET request.

    http://shinobi.video/docs/api#content-trigger-a-motion-event-pretend-to-be-a-motion-engine

    if there is somewhere you can submit to a URL on a trigger that would work with this method.

    about your images. What is "Linkage"?



  • The idea is that I want to make shinobi record only when camera orders it to record. I would like to make motion detection in the camera, so it only send video to shinobi when motion is detected.

    I found this other config about "center platform", as seen in previous images, linkage options have an option to "upload to center" when motion is detected, do you think that this will work with shinobi?

    0_1508899653226_motion4.PNG

    Sorry for ignorance, I am a complete newbie in the ip camera world and all this stuff is new for me



  • Any ideas?


  • administrators

    sorry i hadn't replied. Frankly I don't know enough about your camera. I am not sure if its capable of interfacing with shinobi in the ways that are available (mentioned above). You may need to write a custom script to bridge execution through FTP or email.



  • @moeiscool said in Types of motion:

    If i understand correctly you want don't want shinobi to use the plugin to save traffic on your system?

    the plugin connects using localhost. That shouldn't affect other devices on the network.

    regardless if you would like to skip the plugin you can do it via a GET request.

    http://shinobi.video/docs/api#content-trigger-a-motion-event-pretend-to-be-a-motion-engine

    if there is somewhere you can submit to a URL on a trigger that would work with this method.

    about your images. What is "Linkage"?

    That would be nice if could fetch the ONVIF notifications from Camera.
    Also I'm thinking to buy camera what can be attached with PIR sensor, so it would not react on snow, spiders etc.

    I see it has been discussed already here
    https://www.reddit.com/r/ShinobiCCTV/comments/633lj5/features_list/

    https://www.reddit.com/r/ShinobiCCTV/comments/75rwze/is_there_support_for_onvif_motion_events/

    Edit:
    Also thinking NodeMCU with WiFi and PIR sensor and doing the get request. What do you think?


  • administrators

    oooo very cool. NodeMCU looks promising. As it looks like you can set custom commands to fire. In this case you could make it fire the GET trigger on shinobi http://shinobi.video/docs/api#content-trigger-a-motion-event-pretend-to-be-a-motion-engine This would most likely work very nicely. The device in question would just need to be connected to the network... which i think it already is since its WIFI?

    again sorry for the late reply! 😞



  • Yes I was thinking to use wifi.
    But now ordered two cams with PIR input, so I'll try to fetch the alarm status with node-hikvision-api.

    For my Dahua I'm already testing node-dahua-api nodeJS module for motion and other smart events. The module used net.connect to fetch the data from camera API was not working as new Dahua cams uses digest authentication, I changed that to request and seems working ok. Need to see how request is working in longer run, as it streams the data continuously from the camera API. At least when camera is rebooted it would just hang if no timeout set. Other error handling might need to be added as well.

    Now when removed motion detection in Shinobi, and fetching via camera API the CPU usage is dropped from 2% to near 0%



  • Mostly it works but sometimes I get "undefined" reply and motion is not recorded in the database.

    this is the code

    dahua.on('alarm', function(code,action,index) {
            if (code === 'VideoMotion' && action === 'Start'){      console.log('Video Motion Detected');
    
            request('http://xxx.xxx.xxx.xxx/[API KEY]/motion/[GROUP KEY]/[MONITOR ID]?data={"plug":"Dahua","name":"red","reason":"motion","confidence":1000}', function (error, response, body) {
                    if ((error) || (response.statusCode !== 200) || (body.trim() !== "Trigger Successful")) {
                            console.log('FAILED TO ISSUE COMMAND' + body);
                    }
            })
            }
            if (code === 'VideoMotion' && action === 'Stop')        console.log('Video Motion Ended')
            if (code === 'CrossLineDetection' && action === 'Start') {        console.log('Tripwire Detected');
            request('http://xxx.xxx.xxx.xxx/[API KEY]/motion/[GROUP KEY]/[MONITOR ID]?data={"plug":"Dahua","name":"red","reason":"motion","confidence":3000}', function (error, response, body) {
                                            if ((error) || (response.statusCode !== 200) || (body.trim() !== "Trigger Successful")) {
                                                                            console.log('FAILED TO ISSUE TRIPWIRE COMMAND' + body);
                                                                    }
                                    })
            }
            if (code === 'CrossLineDetection' && action === 'Stop')        console.log('Tripwire Ended')
    });
    

 

Looks like your connection to Shinobi Forum was lost, please wait while we try to reconnect.