### Start Ninja Installer Script Source: https://docs.shinobi.video/installation/raspberry-pi Execute this command in the Raspberry Pi terminal to download and run the Shinobi Ninja Installer script. This script automates the installation process. ```bash sudo su ``` ```bash sh <(curl -s https://cdn.shinobi.video/installers/shinobi-install.sh) ``` -------------------------------- ### Get Capabilities Example Source: https://docs.shinobi.video/api/direct-camera-management-via-onvif Example showing how to retrieve the capabilities of a device using the ONVIF service. ```APIDOC ## Get Capabilities Example ### Description Example showing how to retrieve the capabilities of a device using the ONVIF service. ### Method GET ### Endpoint `http://:[port]/[API_KEY]/onvif/[GROUP_KEY]/[MONITOR_ID]/device/getCapabilities` ### Parameters * **API_KEY** (string) - Required - Your Shinobi API key. * **GROUP_KEY** (string) - Required - The key for the group the monitor belongs to. * **MONITOR_ID** (string) - Required - The unique identifier for the camera monitor. ### Request Example `http://xxx.xxx.xxx.xxx/XXXXXXXXXXXXXXXXX/onvif/2Df5hBE/bunny/device/getCapabilities` ``` -------------------------------- ### Example: Get Device Capabilities Source: https://docs.shinobi.video/api/direct-camera-management-via-onvif This example shows how to retrieve the capabilities of a connected ONVIF device. This is useful for understanding what features and services the camera supports. ```http http://xxx.xxx.xxx.xxx/XXXXXXXXXXXXXXXXX/onvif/2Df5hBE/bunny/device/getCapabilities ``` -------------------------------- ### Example: Set Monitor to Watch-Only with Detector On Source: https://docs.shinobi.video/api/monitor-states-preset-configurations An example of using the insert endpoint to set a specific monitor to 'start' mode and enable its detector engine. Requires monitor ID, API key, group key, and preset name. ```http http://xxx.xxx.xxx.xxx/[API KEY]/monitorStates/[GROUP KEY]/[PRESET_NAME]/insert?data={"monitors":[{"mid":"[MONITOR_ID_1]","mode":"start","details":{"detector":"1"}}]} ``` -------------------------------- ### Install Plugin Dependencies Source: https://docs.shinobi.video/detect/tensorflow-coral-js Navigate to the plugin's directory and run this command to install its necessary dependencies. ```bash npm i ``` -------------------------------- ### Install Google Authentication Library Source: https://docs.shinobi.video/configure/google-sign-in Install the Google Authentication Library for Shinobi using npm. This is a prerequisite for enabling Google Sign-In. ```bash cd /home/Shinobi npm install google-auth-library ``` -------------------------------- ### Install Essential Packages Source: https://docs.shinobi.video/installation/jetson-nano Update package lists and install curl, wget, nano, and net-tools. ```bash apt update && apt install curl wget nano net-tools -y ``` -------------------------------- ### Download and Run Shinobi Installer Source: https://docs.shinobi.video/installation/ninja-way This command downloads and executes the Shinobi installation script from the official CDN. Ensure you have root privileges before running. ```bash sh <(curl -s https://cdn.shinobi.video/installers/shinobi-install.sh) ``` -------------------------------- ### Install Shinobi Management Server Source: https://docs.shinobi.video/system/central-management Installs the Shinobi Management Server to the default /home/mgmt directory. Requires curl and unzip to be installed. ```bash apt install curl unzip -y sh <(curl -s https://cdn.shinobi.video/apps/downloadAndInstallMgmtServer.sh) ``` -------------------------------- ### Install ftp-srv and Modify Shinobi Configuration Source: https://docs.shinobi.video/detect/ftp-events Install the ftp-srv package and use the provided script to add the necessary configuration options to your Shinobi setup. This ensures the FTP server functionality is available. ```bash cd /home/Shinobi npm install ftp-srv node tools/modifyConfiguration.js addToConfig='{"dropInEventServer":true, "ftpServer":true}' ``` -------------------------------- ### Example of Running Shinobi Container Source: https://docs.shinobi.video/installation/docker-windows An example command to run the Shinobi container using a specific image ID. ```bash docker run -d -p 8080:8080 sha256:f3f6ed55e741e260c0b975f8d89f1358018b53ab28b9887ae00e363fd2e3423c ``` -------------------------------- ### Install Shinobi Management Server to Custom Path Source: https://docs.shinobi.video/system/central-management Installs the Shinobi Management Server to a specified custom directory, e.g., /home/mgmt2. Requires curl and unzip to be installed. ```bash sh <(curl -s https://cdn.shinobi.video/apps/downloadAndInstallMgmtServer.sh) /home/mgmt2 ``` -------------------------------- ### Start Plugin as Daemon Source: https://docs.shinobi.video/detect/tensorflow-coral-js Use this command to start the plugin as a daemon process. ```bash npm run startup ``` -------------------------------- ### Download and Run OpenVPN Install Script (Shinobi Mirror) Source: https://docs.shinobi.video/remote/openvpn An alternative command to download and run the OpenVPN installation script from the Shinobi Systems Gitlab mirror. Follow the on-screen prompts for configuration. ```bash wget https://gitlab.com/Shinobi-Systems/openvpn-install/-/raw/master/openvpn-install.sh -O openvpn-install.sh && bash openvpn-install.sh ``` -------------------------------- ### Example: Set Monitor to Record Mode Indefinitely Source: https://docs.shinobi.video/api/monitor-triggers This example demonstrates setting a specific monitor to 'record' mode. The mode will persist until manually changed. ```http http://xxx.xxx.xxx.xxx/XXXXXXXXXXXXXXXXX/monitor/2Df5hBE/bunny/record ``` -------------------------------- ### Install ftp-srv Module Source: https://docs.shinobi.video/detect/ftp-events Install the ftp-srv module if it's not included in your Shinobi installation. This is necessary for FTP-based event triggering. ```bash cd /home/Shinobi npm install ftp-srv ``` -------------------------------- ### Monitor Event Handling Module Source: https://docs.shinobi.video/configure/custom-auto-load-modules Example of a JavaScript module that listens to various monitor events like initialization, start, ping failures, death, and saving. Place this file in /home/Shinobi/libs/customAutoLoad/onMonitorEvents.js. ```javascript module.exports = function(s,config,lang,app,io){ const memoryCachedMonitorModes = {} s.onMonitorInit((initiator) => { console.log('onMonitorInit',initiator,'initiator') }) s.onMonitorStart((monitorConfiguration) => { console.log('onMonitorStart',monitorConfiguration,'monitorConfiguration') }) s.onMonitorPingFailed((monitorConfiguration) => { console.log('onMonitorPingFailed',monitorConfiguration,'monitorConfiguration') }) s.onMonitorDied((monitorConfiguration) => { console.log('onMonitorDied',monitorConfiguration,'monitorConfiguration') }) s.onMonitorSave((newMonitorConfiguration,formPosted,saveRequestResponse) => { // Let's make a simple cache to check if the monitor mode has been changed. const groupKey = newMonitorConfiguration.ke const monitorId = newMonitorConfiguration.mid const cachedMode = memoryCachedMonitorModes[groupKey + monitorId] if(cachedMode !== newMonitorConfiguration.mode){ console.log(`Monitor Mode has Changed! Was ${cachedMode} and is now ${newMonitorConfiguration.mode}`) } memoryCachedMonitorModes[groupKey + monitorId] = newMonitorConfiguration.mode console.log('onMonitorSave',newMonitorConfiguration,'newMonitorConfiguration') console.log('onMonitorSave',formPosted,'formPosted') console.log('onMonitorSave',saveRequestResponse,'saveRequestResponse') }) console.log('Loaded "customAutoLoad" Sample : onMonitorInit, onMonitorStart, onMonitorPingFailed, onMonitorDied, onMonitorSave') } ``` -------------------------------- ### Example: Set Monitor to Record Mode for 10 Minutes Source: https://docs.shinobi.video/api/monitor-triggers This example shows how to set a monitor to 'record' mode for a specific duration (10 minutes). The monitor will automatically revert to 'Disabled' after the time expires. ```http http://xxx.xxx.xxx.xxx/XXXXXXXXXXXXXXXXX/monitor/2Df5hBE/bunny/record/10/min ``` -------------------------------- ### Install Git on Ubuntu Source: https://docs.shinobi.video/system/update Install the Git package if it is not already present on your Ubuntu system. ```bash apt install git ``` -------------------------------- ### Install FFmpeg Static Build with NPM Source: https://docs.shinobi.video/configure/troubleshoot-camera Install a static build of FFmpeg using NPM within your Shinobi directory. This is an alternative to updating your system's FFmpeg. ```bash cd /home/Shinobi npm install ffmpeg-static ``` -------------------------------- ### Download and Run OpenVPN Install Script Source: https://docs.shinobi.video/remote/openvpn Use this command to download and execute Nyr's OpenVPN installation script. Follow the on-screen prompts for configuration. ```bash wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh ``` -------------------------------- ### Install DeepStack Plugin Dependencies Source: https://docs.shinobi.video/detect/deepstack Execute the installation script to set up the necessary dependencies for the DeepStack plugin. ```bash sh INSTALL.sh ``` -------------------------------- ### Install Shinobi using Docker Script Source: https://docs.shinobi.video/installation/docker This command downloads and executes the Shinobi Docker installation script. It's the primary method for setting up Shinobi in a Docker container. Ensure your host OS is compatible. ```bash bash <(curl -s https://gitlab.com/Shinobi-Systems/Shinobi-Installer/raw/master/shinobi-docker.sh) ``` -------------------------------- ### PTZ Move Example Source: https://docs.shinobi.video/api/direct-camera-management-via-onvif Example demonstrating how to perform a PTZ (Pan-Tilt-Zoom) move operation. Options can be appended as a query variable to specify speed and timeout. ```APIDOC ## PTZ Move Example ### Description Example demonstrating how to perform a PTZ (Pan-Tilt-Zoom) move operation. Options can be appended as a query variable to specify speed and timeout. ### Method GET ### Endpoint `http://:[port]/[API_KEY]/onvif/[GROUP_KEY]/[MONITOR_ID]/ptzMove?options=` ### Parameters * **API_KEY** (string) - Required - Your Shinobi API key. * **GROUP_KEY** (string) - Required - The key for the group the monitor belongs to. * **MONITOR_ID** (string) - Required - The unique identifier for the camera monitor. * **options** (string) - Optional - A JSON string specifying PTZ movement options, e.g., `{"speed":{"x":1,"y":0,"z":0},"timeout":1}`. ### Request Example `http://xxx.xxx.xxx.xxx/XXXXXXXXXXXXXXXXX/onvif/2Df5hBE/bunny/ptzMove?options={"speed":{"x":1,"y":0,"z":0},"timeout":1}` ``` -------------------------------- ### Install discord.js and Enable Discord Bot in Shinobi Source: https://docs.shinobi.video/notifications/discord Install the discord.js Node.js module and add the 'discordBot': true setting to Shinobi's conf.json. Restart the camera.js process to apply changes. ```bash cd /home/Shinobi npm install discord.js node tools/modifyConfiguration.js addToConfig='{"discordBot":true}' pm2 restart camera.js ``` -------------------------------- ### Example: PTZ Move Command Source: https://docs.shinobi.video/api/direct-camera-management-via-onvif This example demonstrates how to move a PTZ (Pan-Tilt-Zoom) enabled camera. Options for speed and timeout can be appended as a JSON string to the 'options' query variable. ```http http://xxx.xxx.xxx.xxx/XXXXXXXXXXXXXXXXX/onvif/2Df5hBE/bunny/ptzMove?options={"speed":{"x":1,"y":0,"z":0},"timeout":1} ``` -------------------------------- ### Install nvm and Update Node.js Source: https://docs.shinobi.video/faqs/not-working-after-update Install Node Version Manager (nvm) to manage Node.js versions. Update Node.js to at least version 22 to ensure compatibility with recent Shinobi updates. ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -------------------------------- ### Install NVIDIA Drivers, CUDA, and cuDNN Source: https://docs.shinobi.video/detect/deepstack Installs NVIDIA display drivers, CUDA Toolkit, and cuDNN using a one-liner script. This is essential for GPU acceleration. ```bash bash <(curl -s https://gitlab.com/Shinobi-Systems/Shinobi/-/raw/dev/INSTALL/cuda-10-2.sh) ``` -------------------------------- ### Install Telegram Bot API and Configure Shinobi Source: https://docs.shinobi.video/notifications/telegram Installs the necessary Node.js package for Telegram bots and modifies the Shinobi configuration to enable the bot. Restarts the Shinobi process using PM2. ```bash cd /home/Shinobi npm install node-telegram-bot-api node tools/modifyConfiguration.js addToConfig='{"telegramBot":true}' pm2 restart camera.js ``` -------------------------------- ### Install Git on CentOS Source: https://docs.shinobi.video/system/update Install the Git package if it is not already present on your CentOS system. ```bash yum install git ``` -------------------------------- ### Example Hosts File Modification Source: https://docs.shinobi.video/configure/google-sign-in This is an example of a hosts file modification on Windows 10 to simulate a custom domain for accessing the Shinobi server. This allows the use of custom domains in Google Application Authorized Origins. ```text # Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # ``` -------------------------------- ### Get Videos with Custom Start Operator Source: https://docs.shinobi.video/api/get-videos Retrieve videos using a custom start operator (e.g., '>='). This allows for flexible filtering based on the video's start time. ```http http://xxx.xxx.xxx.xxx/[API KEY]/videos/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&startOperator=>= ``` -------------------------------- ### Example Shinobi Stream URL Source: https://docs.shinobi.video/faqs/viewing-shinobi-through-vlc This is an example of a temporary stream URL generated by Shinobi. The structure includes protocol, host, port, API key, group key, and monitor ID. ```text http://192.168.1.31:8080/7e5cc9e74bf49e044f1b49110e6d6cf8/mp4/STXJcIf/dtcLu5dDZ1/s.mp4 ``` -------------------------------- ### Get Alarms After Start Time Source: https://docs.shinobi.video/api/alarms Retrieve alarms that occurred after a specified start time. This allows for fetching recent alarm events. ```http http://xxx.xxx.xxx.xxx/[API KEY]/alarms/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss ``` -------------------------------- ### Example: Set Monitor to Disabled with Detector Off Source: https://docs.shinobi.video/api/monitor-states-preset-configurations An example of using the insert endpoint to set a specific monitor to 'stop' mode and disable its detector engine. Requires monitor ID, API key, group key, and preset name. ```http http://xxx.xxx.xxx.xxx/[API KEY]/monitorStates/[GROUP KEY]/[PRESET_NAME]/insert?data={"monitors":[{"mid":"[MONITOR_ID_1]","mode":"stop","details":{"detector":"0"}}]} ``` -------------------------------- ### Get Videos After Start Time Source: https://docs.shinobi.video/api/get-videos Retrieve videos recorded after a specified start time. The time format must be YYYY-MM-DDTHH:mm:ss. ```http http://xxx.xxx.xxx.xxx/[API KEY]/videos/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss ``` -------------------------------- ### Get Timelapse Frames Between Start and End Times Source: https://docs.shinobi.video/api/get-timelapse Retrieve timelapse frames within a specified time range, defined by start and end times. ```http http://xxx.xxx.xxx.xxx/[API KEY]/timelapse/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss ``` -------------------------------- ### Get Timelapse Frames After Start Time Source: https://docs.shinobi.video/api/get-timelapse Retrieve timelapse frames recorded after a specified start time. The time format is YYYY-MM-DDTHH:mm:ss. ```http http://xxx.xxx.xxx.xxx/[API KEY]/timelapse/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss ``` -------------------------------- ### Get Alarms with Custom Start Operator Source: https://docs.shinobi.video/api/alarms Retrieve alarms using a custom start operator (e.g., '>='). This allows for more flexible time-based filtering of alarm records. ```http http://xxx.xxx.xxx.xxx/[API KEY]/alarms/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&startOperator=>= ``` -------------------------------- ### Get Timelapse Frames with Custom Start Operator Source: https://docs.shinobi.video/api/get-timelapse Retrieve timelapse frames using a custom start operator (e.g., '>=') to define the time range precisely. ```http http://xxx.xxx.xxx.xxx/[API KEY]/timelapse/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&startOperator=>= ``` -------------------------------- ### Enable MQTT and Restart Shinobi Source: https://docs.shinobi.video/detect/mqtt Installs the MQTT module and restarts Shinobi to enable MQTT features. This is a prerequisite for configuring MQTT Inbound and Outbound. ```bash cd /home/Shinobi npm install mqtt@4.2.8 node tools/modifyConfiguration.js addToConfig='{"mqttClient":true}' pm2 restart camera.js ``` -------------------------------- ### Get Events After Start Time Source: https://docs.shinobi.video/api/get-events Retrieve detection events that occurred after a specified start time for a given monitor. The time format is YYYY-MM-DDTHH:mm:ss. ```bash http://xxx.xxx.xxx.xxx/[API KEY]/events/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss ``` -------------------------------- ### Get Timelapse Frames between start time and end time Source: https://docs.shinobi.video/api/get-timelapse Retrieves timelapse frames that fall within a specified time range, defined by both a start and an end time. ```APIDOC ## GET /timelapse/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss ### Description Retrieves timelapse frames between a specified start and end time. ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/timelapse/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss` ### Parameters #### Path Parameters - **[API KEY]** (string) - Required - Your API key for authentication. - **[GROUP KEY]** (string) - Required - The key identifying the group. - **[MONITOR ID]** (string) - Required - The ID of the monitor. #### Query Parameters - **start** (string) - Required - The start time in `YYYY-MM-DDTHH:mm:ss` format. - **end** (string) - Required - The end time in `YYYY-MM-DDTHH:mm:ss` format. ``` -------------------------------- ### Get Timelapse Frames after start time Source: https://docs.shinobi.video/api/get-timelapse Retrieves timelapse frames that were captured after a specified start time. Useful for fetching data within a specific time window. ```APIDOC ## GET /timelapse/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss ### Description Retrieves timelapse frames captured after a specified start time. ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/timelapse/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss` ### Parameters #### Path Parameters - **[API KEY]** (string) - Required - Your API key for authentication. - **[GROUP KEY]** (string) - Required - The key identifying the group. - **[MONITOR ID]** (string) - Required - The ID of the monitor. #### Query Parameters - **start** (string) - Required - The start time in `YYYY-MM-DDTHH:mm:ss` format. Frames captured after this time will be returned. ``` -------------------------------- ### Get Files After Start Time Source: https://docs.shinobi.video/api/get-fileBin Retrieve files from a specific monitor ID that were created after a specified start time. The time format must be YYYY-MM-DDTHH:mm:ss. ```http http://xxx.xxx.xxx.xxx/[API KEY]/fileBin/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss ``` -------------------------------- ### Add New User Connection File Source: https://docs.shinobi.video/remote/openvpn Run the installation script again and select the first option to generate a new .ovpn connection file for an additional user. Ensure the name is unique. ```bash bash openvpn-install.sh ``` -------------------------------- ### Get Timelapse Frames with custom start operator Source: https://docs.shinobi.video/api/get-timelapse Retrieves timelapse frames using a custom operator for the start time, allowing for flexible time-based filtering (e.g., greater than, less than). ```APIDOC ## GET /timelapse/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&startOperator=>= ### Description Retrieves timelapse frames with a custom start operator. ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/timelapse/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&startOperator=>=` ### Parameters #### Path Parameters - **[API KEY]** (string) - Required - Your API key for authentication. - **[GROUP KEY]** (string) - Required - The key identifying the group. - **[MONITOR ID]** (string) - Required - The ID of the monitor. #### Query Parameters - **start** (string) - Required - The start time in `YYYY-MM-DDTHH:mm:ss` format. - **startOperator** (string) - Required - The operator to use for the start time comparison (e.g., `>=`, `<=`, `>`, `<`). ``` -------------------------------- ### Get Alarms Between Start and End Times Source: https://docs.shinobi.video/api/alarms Retrieve alarms that occurred within a specific time range, defined by both a start and an end time. This provides precise control over the fetched alarm data. ```http http://xxx.xxx.xxx.xxx/[API KEY]/alarms/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss ``` -------------------------------- ### Get Videos Between Start and End Times Source: https://docs.shinobi.video/api/get-videos Retrieve videos recorded within a specific time range, defined by both start and end times. Both times must be in YYYY-MM-DDTHH:mm:ss format. ```http http://xxx.xxx.xxx.xxx/[API KEY]/videos/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss ``` -------------------------------- ### Enter New Plugin Directory Source: https://docs.shinobi.video/create/detector-plugin Navigate into the newly created directory for your custom plugin. ```bash cd plugins/gundetector ``` -------------------------------- ### Get Files with Custom Start Operator Source: https://docs.shinobi.video/api/get-fileBin Retrieve files from a specific monitor ID using a custom start operator, such as '>=' for 'greater than or equal to'. The time format must be YYYY-MM-DDTHH:mm:ss. ```http http://xxx.xxx.xxx.xxx/[API KEY]/fileBin/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&startOperator=>= ``` -------------------------------- ### Get Events Between Start and End Times Source: https://docs.shinobi.video/api/get-events Retrieve detection events that occurred within a specific time range (between start and end times) for a given monitor. Both times should be in YYYY-MM-DDTHH:mm:ss format. ```bash http://xxx.xxx.xxx.xxx/[API KEY]/events/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss ``` -------------------------------- ### Get Events with Custom Start Operator Source: https://docs.shinobi.video/api/get-events Retrieve detection events using a custom start operator (e.g., '>=') to define the beginning of the time range for a given monitor. The time format is YYYY-MM-DDTHH:mm:ss. ```bash http://xxx.xxx.xxx.xxx/[API KEY]/events/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&startOperator=>= ``` -------------------------------- ### Enabling Superuser Access Source: https://docs.shinobi.video/system/superuser Copies the sample superuser credentials file to the active configuration file, enabling superuser access. Requires restarting the Shinobi service afterwards. ```bash cp /home/Shinobi/super.sample.json /home/Shinobi/super.json ``` -------------------------------- ### Start DeepStack Plugin Source: https://docs.shinobi.video/detect/deepstack Run the DeepStack plugin for Shinobi. This command initiates the plugin and makes it available for use. ```javascript node shinobi-deepstack-object.js ``` -------------------------------- ### Get Files Between Start and End Times Source: https://docs.shinobi.video/api/get-fileBin Retrieve files from a specific monitor ID that fall within a given time range, specified by both start and end times. The time format must be YYYY-MM-DDTHH:mm:ss. ```http http://xxx.xxx.xxx.xxx/[API KEY]/fileBin/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss ``` -------------------------------- ### Get Videos with Time Range Filters Source: https://docs.shinobi.video/api/get-videos Retrieves videos filtered by start time, end time, or both, allowing for precise temporal querying. ```APIDOC ## GET /videos/[GROUP KEY]/[MONITOR ID]?start=&end= ### Description Retrieves videos filtered by start time, end time, or both, allowing for precise temporal querying. ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/videos/[GROUP KEY]/[MONITOR ID]` ### Parameters #### Path Parameters - **API KEY** (string) - Required - Your API key for authentication. - **GROUP KEY** (string) - Required - The key identifying the group of monitors. - **MONITOR ID** (string) - Required - The ID of the specific monitor. #### Query Parameters - **start** (string) - Optional - The start time in `YYYY-MM-DDTHH:mm:ss` format. - **end** (string) - Optional - The end time in `YYYY-MM-DDTHH:mm:ss` format. - **startOperator** (string) - Optional - Custom operator for start time (e.g., `>=`). - **endOperator** (string) - Optional - Custom operator for end time (e.g., `<=`). - **endIsStartTo** (boolean) - Optional - If true, the `end` parameter is treated as the start time of the video, not the end time. ### Response #### Success Response (200) Returns a list of video objects matching the time criteria. ``` -------------------------------- ### Get Alarms with Time Filters Source: https://docs.shinobi.video/api/alarms Retrieves alarms for a specific monitor ID, with options to filter by start time, end time, or both, using custom operators. ```APIDOC ## GET /alarms/[GROUP KEY]/[MONITOR ID] ### Description Retrieves alarms for a specific monitor ID, with options to filter by start time, end time, or both, using custom operators. ### Method GET ### Endpoint `/alarms/[GROUP KEY]/[MONITOR ID]` ### Parameters #### Path Parameters - **GROUP KEY** (string) - Required - The key of the group. - **MONITOR ID** (string) - Required - The ID of the monitor to retrieve alarms for. - **API KEY** (string) - Required - Your API key for authentication. #### Query Parameters - **start** (string) - Optional - The start time for filtering alarms (format: YYYY-MM-DDTHH:mm:ss). - **end** (string) - Optional - The end time for filtering alarms (format: YYYY-MM-DDTHH:mm:ss). - **startOperator** (string) - Optional - The operator to use for the start time comparison (e.g., `>=`). - **endOperator** (string) - Optional - The operator to use for the end time comparison (e.g., `<=`). ### Example Usage: - Get alarms after start time: `?start=YYYY-MM-DDTHH:mm:ss` - Get alarms before end time: `?end=YYYY-MM-DDTHH:mm:ss` - Get alarms between start and end time: `?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss` - Get alarms with custom start operator: `?start=YYYY-MM-DDTHH:mm:ss&startOperator=>=` - Get alarms with custom end operator: `?end=YYYY-MM-DDTHH:mm:ss&endOperator<=` ``` -------------------------------- ### Get Files by Time Range Source: https://docs.shinobi.video/api/get-fileBin Retrieves files within a specified time range (start and/or end times) for a given monitor ID and group key. ```APIDOC ## GET /fileBin/[GROUP KEY]/[MONITOR ID]?start=[YYYY-MM-DDTHH:mm:ss]&end=[YYYY-MM-DDTHH:mm:ss] ### Description Retrieves files within a specified time range (start and/or end times) for a given monitor ID and group key. ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/fileBin/[GROUP KEY]/[MONITOR ID]` ### Parameters #### Path Parameters - **[API KEY]** (string) - Required - Your API key for authentication. - **[GROUP KEY]** (string) - Required - The key identifying the group of files. - **[MONITOR ID]** (string) - Required - The ID of the monitor whose files are to be retrieved. #### Query Parameters - **start** (string) - Optional - The start time in `YYYY-MM-DDTHH:mm:ss` format. Can use `startOperator` for custom comparison. - **end** (string) - Optional - The end time in `YYYY-MM-DDTHH:mm:ss` format. Can use `endOperator` for custom comparison. - **startOperator** (string) - Optional - Custom operator for the start time (e.g., `>=`). Defaults to `>=`. - **endOperator** (string) - Optional - Custom operator for the end time (e.g., `<=`). Defaults to `<= `. ### Response #### Success Response (200) Returns a list of files matching the specified criteria. ``` -------------------------------- ### Get Videos with Time Restrictions (startTo) Source: https://docs.shinobi.video/api/get-videos Retrieve videos where the 'end' parameter is treated as the start time of the video, using 'endIsStartTo'. This is useful for searching based on when a video began. ```http http://xxx.xxx.xxx.xxx/[API KEY]/videos/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss&endIsStartTo ``` -------------------------------- ### Get alarms with time restrictions as startFrom and startTo Source: https://docs.shinobi.video/api/alarms Retrieves alarms, allowing filtering by both start and end times. The `endIsStartTo` parameter can be used to specify that the `end` parameter should be treated as a start-to time. ```APIDOC ## GET /alarms/[GROUP KEY]/[MONITOR ID] ### Description Retrieves alarms for a specific monitor within a group, with optional time-based filtering. ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/alarms/[GROUP KEY]/[MONITOR ID]` ### Parameters #### Query Parameters - **start** (string) - Optional - The start time for filtering alarms in `YYYY-MM-DDTHH:mm:ss` format. - **end** (string) - Optional - The end time for filtering alarms in `YYYY-MM-DDTHH:mm:ss` format. - **endIsStartTo** (boolean) - Optional - If true, the `end` parameter is treated as a start-to time. ### Request Example ``` http://xxx.xxx.xxx.xxx/[API KEY]/alarms/[GROUP KEY]/[MONITOR ID]?start=2023-10-26T10:00:00&end=2023-10-26T12:00:00&endIsStartTo=true ``` ### Response #### Success Response (200) - **alarms** (array) - A list of alarm objects. - **timestamp** (string) - The time the alarm occurred. - **message** (string) - The alarm message. - **id** (string) - The unique identifier for the alarm. ``` -------------------------------- ### Get Alarms with Time Restrictions (startFrom and startTo) Source: https://docs.shinobi.video/api/alarms Retrieve alarms within a specified time range using 'startFrom' and 'startTo' parameters. This method searches based on alarm start times. ```http http://xxx.xxx.xxx.xxx/[API KEY]/alarms/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss&endIsStartTo ``` -------------------------------- ### Get Detection Events Source: https://docs.shinobi.video/api/get-events Retrieve saved detection events. You can filter events by group key, monitor ID, and specify time ranges using start and end parameters with optional operators. ```APIDOC ## GET /events/[GROUP KEY] ### Description Retrieves all detection events associated with a specific group key. ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/events/[GROUP KEY]` ### Parameters #### Path Parameters - **[API KEY]** (string) - Required - Your API key for authentication. - **[GROUP KEY]** (string) - Required - The key identifying the group of events to retrieve. ## GET /events/[GROUP KEY]/[MONITOR ID] ### Description Retrieves detection events for a specific monitor within a group. ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/events/[GROUP KEY]/[MONITOR ID]` ### Parameters #### Path Parameters - **[API KEY]** (string) - Required - Your API key for authentication. - **[GROUP KEY]** (string) - Required - The key identifying the group of events. - **[MONITOR ID]** (string) - Required - The ID of the monitor to retrieve events for. ## GET /events/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss ### Description Retrieves detection events for a specific monitor that occurred after a specified start time. ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/events/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss` ### Parameters #### Path Parameters - **[API KEY]** (string) - Required - Your API key for authentication. - **[GROUP KEY]** (string) - Required - The key identifying the group of events. - **[MONITOR ID]** (string) - Required - The ID of the monitor to retrieve events for. #### Query Parameters - **start** (string) - Required - The start time in `YYYY-MM-DDTHH:mm:ss` format. ## GET /events/[GROUP KEY]/[MONITOR ID]?end=YYYY-MM-DDTHH:mm:ss ### Description Retrieves detection events for a specific monitor that occurred before a specified end time. ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/events/[GROUP KEY]/[MONITOR ID]?end=YYYY-MM-DDTHH:mm:ss` ### Parameters #### Path Parameters - **[API KEY]** (string) - Required - Your API key for authentication. - **[GROUP KEY]** (string) - Required - The key identifying the group of events. - **[MONITOR ID]** (string) - Required - The ID of the monitor to retrieve events for. #### Query Parameters - **end** (string) - Required - The end time in `YYYY-MM-DDTHH:mm:ss` format. ## GET /events/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss ### Description Retrieves detection events for a specific monitor that occurred between a specified start and end time. ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/events/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&end=YYYY-MM-DDTHH:mm:ss` ### Parameters #### Path Parameters - **[API KEY]** (string) - Required - Your API key for authentication. - **[GROUP KEY]** (string) - Required - The key identifying the group of events. - **[MONITOR ID]** (string) - Required - The ID of the monitor to retrieve events for. #### Query Parameters - **start** (string) - Required - The start time in `YYYY-MM-DDTHH:mm:ss` format. - **end** (string) - Required - The end time in `YYYY-MM-DDTHH:mm:ss` format. ## GET /events/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&startOperator=>= ### Description Retrieves detection events for a specific monitor using a custom start operator (e.g., `>=`). ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/events/[GROUP KEY]/[MONITOR ID]?start=YYYY-MM-DDTHH:mm:ss&startOperator=>=` ### Parameters #### Path Parameters - **[API KEY]** (string) - Required - Your API key for authentication. - **[GROUP KEY]** (string) - Required - The key identifying the group of events. - **[MONITOR ID]** (string) - Required - The ID of the monitor to retrieve events for. #### Query Parameters - **start** (string) - Required - The start time in `YYYY-MM-DDTHH:mm:ss` format. - **startOperator** (string) - Required - The custom operator for the start time comparison (e.g., `>=`, `>`, `<=`, `<`). ## GET /events/[GROUP KEY]/[MONITOR ID]?end=YYYY-MM-DDTHH:mm:ss&endOperator=<= ### Description Retrieves detection events for a specific monitor using a custom end operator (e.g., `<=`). ### Method GET ### Endpoint `http://xxx.xxx.xxx.xxx/[API KEY]/events/[GROUP KEY]/[MONITOR ID]?end=YYYY-MM-DDTHH:mm:ss&endOperator<=` ### Parameters #### Path Parameters - **[API KEY]** (string) - Required - Your API key for authentication. - **[GROUP KEY]** (string) - Required - The key identifying the group of events. - **[MONITOR ID]** (string) - Required - The ID of the monitor to retrieve events for. #### Query Parameters - **end** (string) - Required - The end time in `YYYY-MM-DDTHH:mm:ss` format. - **endOperator** (string) - Required - The custom operator for the end time comparison (e.g., `>=`, `>`, `<=`, `<`). ``` -------------------------------- ### Enable Plugins Cluster Mode via Command Line Source: https://docs.shinobi.video/configure/plugins-cluster-mode Use this Node.js script command to add the cluster mode configuration to Shinobi's settings. ```bash node tools/modifyConfiguration.js addToConfig='{"detectorPluginsCluster":true}' ``` -------------------------------- ### Enable GPU Utilization Check via Command Line Source: https://docs.shinobi.video/configure/plugins-cluster-mode Use this Node.js script command to add the GPU utilization check configuration to Shinobi's settings. ```bash node tools/modifyConfiguration.js addToConfig='{"clusterBasedOnGpu":true}' ``` -------------------------------- ### Insert a Schedule Source: https://docs.shinobi.video/api/scheduling-for-monitors Insert or update a schedule. The 'data' query string must include start time, end time, enabled status, and an array of monitor states. The example shows a schedule from 10:00 AM to 9:00 PM activating the 'detectorsOn' monitor state. ```json { "start": "10:00", "end": "21:00", "details": { "monitorStates": [ "detectorsOn" ] }, "enabled": 1 } ``` ```http http://xxx.xxx.xxx.xxx/[API KEY]/schedule/[GROUP KEY]/[SCHEDULE_NAME]/insert?data={...} ``` -------------------------------- ### Add New User to Management Server Source: https://docs.shinobi.video/system/central-management Create a new user for the Management Server via the command line. Replace USERNAME and PASSWORD with your desired credentials. All users created this way have complete access during the open beta. ```bash node tools/addNewUser.js USERNAME PASSWORD ``` -------------------------------- ### Enable CPU Utilization Check via Command Line Source: https://docs.shinobi.video/configure/plugins-cluster-mode Use this Node.js script command to add the CPU utilization check configuration to Shinobi's settings. ```bash node tools/modifyConfiguration.js addToConfig='{"clusterUseBasicFrameCount":false}' ``` -------------------------------- ### Set File System Permissions Source: https://docs.shinobi.video/configure/troubleshoot-camera Ensure that Shinobi has the necessary read and write permissions for its video and stream directories. This is crucial for proper operation. ```bash sudo chmod -R 755 /dev/shm/streams sudo chmod -R 755 /home/Shinobi/videos ``` -------------------------------- ### Daemonize Detector Plugin with PM2 Source: https://docs.shinobi.video/create/detector-plugin Start your custom detector plugin as a background process using PM2 for continuous operation alongside Shinobi. ```bash pm2 start shinobi-gundetector.js ``` -------------------------------- ### Install NVIDIA Docker Source: https://docs.shinobi.video/detect/deepstack Installs NVIDIA Docker support, enabling Docker containers to utilize the host's NVIDIA GPU. This involves adding the NVIDIA Docker repository and installing the nvidia-docker2 package. ```bash curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ sudo apt-key add - distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \ sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt-get update sudo apt-get install -y nvidia-docker2 sudo pkill -SIGHUP dockerd ``` -------------------------------- ### Become Root on Ubuntu Source: https://docs.shinobi.video/installation/ninja-way Use this command to gain root privileges on Ubuntu systems before running the installer. ```bash sudo su ``` -------------------------------- ### Configure Shinobi for SSL Source: https://docs.shinobi.video/system/enable-ssl-self-signed Add the SSL configuration to Shinobi's conf.json file. This tells Shinobi where to find the generated private key and certificate files for HTTPS. ```json "ssl": { "key": "./ssl/key.pem", "cert": "./ssl/cert.pem" } ``` -------------------------------- ### Start DeepStack Container with GPU Support Source: https://docs.shinobi.video/detect/deepstack Launches a DeepStack container, enabling GPU acceleration and exposing the detection API on port 5000. It maps local storage for data persistence and enables face and object detection. ```bash sudo docker run --gpus all -e VISION-FACE=True -e VISION-DETECTION=True -v localstorage:/datastore -p 5000:5000 deepquestai/deepstack:gpu ```