From 9f7a6bd185d5dbda40357fe93e39fc8aab393c8d Mon Sep 17 00:00:00 2001 From: crxporter <38265886+crxporter@users.noreply.github.com> Date: Fri, 18 Feb 2022 16:07:27 -0600 Subject: [PATCH 1/6] Beginning the transition to the new ffmpeg build Changing links, updating my examples, etc. --- content/wiki/service/camera-control/index.md | 86 ++++++-------------- 1 file changed, 27 insertions(+), 59 deletions(-) diff --git a/content/wiki/service/camera-control/index.md b/content/wiki/service/camera-control/index.md index 5fcfa80cb..9238972de 100644 --- a/content/wiki/service/camera-control/index.md +++ b/content/wiki/service/camera-control/index.md @@ -3,7 +3,7 @@ title: "Camera Control" description: "Camera Control" lead: "" date: 2021-04-17T18:50:12.026Z -lastmod: 2021-10-09T12:01:54.995Z +lastmod: 2022-02-18T22:06:22.437Z draft: false images: [] menu: @@ -17,28 +17,32 @@ contributors: ["caitken-com", "crxporter", "itsj4y", "Shaquu"] ## Notes on Cameras -Cameras are a complicated situation. If you are running the [Docker way](https://github.com/NRCHKB/node-red-contrib-homekit-docker) then FFMPEG will be preinstalled for you with several of the options preset (may not have all hardware accelerations built). Alternately you can download and compile your own version of FFMPEG with the build flags you need for your cameras. +Cameras are a complicated situation. If you are running the [Docker way](https://github.com/NRCHKB/node-red-contrib-homekit-docker) then FFmpeg will be preinstalled for you with several of the options preset (may not have all hardware accelerations built). If you are on a system with `apt` (Raspberry pi, Ubuntu, Debian, etc) you can use the FFmpeg install script which is maintained by a couple of our users and designed for nrchkb users. This script is documented [here](https://github.com/marcus-j-davies/nrchkb-ffmpeg-build) and can be run at any time using this one-line terminal command then following the prompts: -For those writing examples, please include how you have installed FFMPEG! +``` +bash <(curl -sL https://raw.githubusercontent.com/marcus-j-davies/nrchkb-ffmpeg-build/main/nrchkb-ffmpeg-build.sh) +``` + +For those writing examples, please include how you have installed FFmpeg (including any special build flags)! -It is recommended to add only one camera per bridge. The camera should be the "parent" service with "motion" and "doorbell" (if used) as linked services. +It is recommended use "Accessory" as the Host Type for cameras. The camera should be the "parent" service with "motion" and "doorbell" (if used) as linked services. ### How to debug issues -If you have problems with FFMPEG (if you think the camera is set up properly but it "does nothing" then you might have FFMPEG problems) then please follow these steps to properly debug your FFMPEG setup. +If you have problems with FFmpeg (if you think the camera is set up properly but it "does nothing" then you might have FFmpeg problems) then please follow these steps to properly debug your FFmpeg setup. - Configure Camera Control node in Node-RED - Run Node-RED with `DEBUG=NRCHKB*,CameraSource*` and tick "debug mode" in Camera Control - ![Camera Control Debug checkbox](camera-control-debug.png) - Try to open Camera stream in Home.app -- It will error again but will also print FFMPEG command in logs +- It will error again but will also print FFmpeg command in logs - Run that command in terminal separately to get real problem ## Examples ### * Raspberry Pi Zero W -Example written by CRXPorter. Date 21 November 2020. Plugin version 1.2.0, Node-RED version 1.2.5. +Example written by CRXPorter. Date 21 November 2020, updated February, 2022. Plugin version 1.4.3, Node-RED version 2.1.5. Hardware:\ -Raspberry Pi Zero W\ @@ -50,7 +54,11 @@ Step **zero**: I assume you are able to set up a pi zero with SSH and Wi-Fi. I a Step **one**: use `raspi-config` to enable the camera interface on the pi -Step **two**: install FFMPEG for HomeBridge using the script [found here](https://github.com/homebridge/ffmpeg-for-homebridge) +Step **two**: install FFmpeg for HomeBridge using our script: + +``` +bash <(curl -sL https://raw.githubusercontent.com/marcus-j-davies/nrchkb-ffmpeg-build/main/nrchkb-ffmpeg-build.sh) +``` Step **three**: install and start Node-RED with the script [found here](https://Node-RED.org/docs/getting-started/raspberrypi) @@ -59,11 +67,9 @@ Step **four**: install node-red-contrib-homekit-bridged from palette manager Step **five**: import this flow. It should be a single homekit node ```json -[{"id":"36df1f80.39e34","type":"homekit-service","z":"c9e35eda.bb75f8","isParent":true,"bridge":"f18ad79f.5081e8","parentService":"","name":"Pi zero camera","serviceName":"CameraControl","topic":"","filter":false,"manufacturer":"NRCHKB","model":"1.2.0","serialNo":"Default Serial Number","firmwareRev":"1.2.0","hardwareRev":"1.2.0","softwareRev":"1.2.0","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"-re -r 6 -s 1280x720 -f video4linux2 -i /dev/video0","cameraConfigStillImageSource":"-s 1280x720 -f video4linux2 -i /dev/video0","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":"1280","cameraConfigMaxHeight":"720","cameraConfigMaxFPS":"6","cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"h264_omx","cameraConfigAudioCodec":"h264_omx","cameraConfigAudio":false,"cameraConfigPacketSize":"564","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{}","waitForSetupMsg":false,"outputs":3,"x":430,"y":260,"wires":[[],[],[]]},{"id":"f18ad79f.5081e8","type":"homekit-bridge","bridgeName":"Camera","pinCode":"111-11-111","port":"","allowInsecureRequest":false,"manufacturer":"Raspberry Pi","model":"Pi zero w","serialNo":"00001","firmwareRev":"1.2.0","hardwareRev":"1.2.0","softwareRev":"1.2.0","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":true}] +[{"id":"36df1f80.39e34","type":"homekit-service","z":"c9e35eda.bb75f8","isParent":true,"bridge":"f18ad79f.5081e8","parentService":"","name":"Pi zero camera","serviceName":"CameraControl","topic":"","filter":false,"manufacturer":"NRCHKB","model":"1.2.0","serialNo":"Default Serial Number","firmwareRev":"1.2.0","hardwareRev":"1.2.0","softwareRev":"1.2.0","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"-re -r 6 -s 1280x720 -f video4linux2 -i /dev/video0","cameraConfigStillImageSource":"-s 1280x720 -f video4linux2 -i /dev/video0","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":"1280","cameraConfigMaxHeight":"720","cameraConfigMaxFPS":"6","cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"h264_v4l2m2m","cameraConfigAudioCodec":"h264_v4l2m2m","cameraConfigAudio":false,"cameraConfigPacketSize":"564","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{}","waitForSetupMsg":false,"outputs":3,"x":430,"y":260,"wires":[[],[],[]]},{"id":"f18ad79f.5081e8","type":"homekit-bridge","bridgeName":"Camera","pinCode":"111-11-111","port":"","allowInsecureRequest":false,"manufacturer":"Raspberry Pi","model":"Pi zero w","serialNo":"00001","firmwareRev":"1.2.0","hardwareRev":"1.2.0","softwareRev":"1.2.0","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":true}] ``` -(Note to self: need to add this to the examples for next release) - Step **six**: add it to your Home.app and enjoy! Notes:\ @@ -90,54 +96,16 @@ Cameras tested: - Unifi G3 Bullet - Unifi G4 Doorbell -Motion detection and doorbell presses are available for advanced users, ask @crxporter on discord. A new Unifi node is pending from CRXPorter - hopefully coming late 2020. - -FFMPEG was installed on a pi 4. Node-RED was installed with the official Node-RED on pi install script. - -#### FFMPEG Install +Motion detection and doorbell presses are available for advanced users, ask @crxporter on discord. A new Unifi node is in active development, check [here](https://github.com/NRCHKB/node-red-contrib-unifi-os) for that project. -Install build tools +FFmpeg was installed on a pi 4. Node-RED was installed with the official Node-RED on pi install script. -```bash -sudo apt install git pkg-config autoconf automake libtool libx264-dev -``` - -ALSA runtime library +#### FFmpeg Install -```bash -sudo apt install libasound2-dev -``` +Just run the `nrchkb-ffmpeg-build` script found here: -Download and build fdk-aac - -```bash -cd ~ -git clone https://github.com/mstorsjo/fdk-aac.git -cd fdk-aac -sudo ./autogen.sh -sudo ./configure --prefix=/usr/local --enable-shared --enable-static -sudo make -j4 -sudo make install -sudo ldconfig ``` - -Download and build ffmpeg - -```bash -cd ~ -git clone https://github.com/FFmpeg/FFmpeg.git -cd FFmpeg -sudo ./configure --prefix=/usr/local --arch=armel --target-os=linux --enable-omx-rpi --enable-nonfree --enable-gpl --enable-libfdk-aac --enable-mmal --enable-libx264 --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-demuxer=rtsp -sudo make -j4 -sudo make install -``` - -Clean up - -```bash -cd ~ -rm -rf FFmpeg -rm -rf fdk-aac +bash <(curl -sL https://raw.githubusercontent.com/marcus-j-davies/nrchkb-ffmpeg-build/main/nrchkb-ffmpeg-build.sh) ``` #### Cameras Setup @@ -153,17 +121,17 @@ Max Width: 960 Max Height: 720 Max FPS: 10 Max Bitrate: 3072 -Video Codec: h264_omx +Video Codec: copy Audio Codec: libfdk_aac Audio: yes Packet Sixe: 564 -Map Video: 0:1 -Map Audio: 0:0 -Video Filter: scale=960:720 +Map Video: 0:v +Map Audio: 0:a +Video Filter: Additional Command Line: -preset slow -profile:v high -level 4.2 -x264-params intra-refresh=1:bframes=0 ``` -This is a work in progress. Written October 9, 2020. Please find me (crxporter) on [our discord server](https://discord.gg/uvYac5u) if you're having problems or would like more information. +This is a work in progress. Updated 18 February 2022. Please find me (crxporter) on [our discord server](https://discord.gg/uvYac5u) if you're having problems or would like more information. ### * Reolink From fc413eb7cd9c2b735402d4d2fa27824de3246aa3 Mon Sep 17 00:00:00 2001 From: crxporter <38265886+crxporter@users.noreply.github.com> Date: Fri, 18 Feb 2022 16:17:29 -0600 Subject: [PATCH 2/6] Updating ffmpeg instructions --- content/wiki/service/camera-control/index.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/wiki/service/camera-control/index.md b/content/wiki/service/camera-control/index.md index 9238972de..00e0e1b7d 100644 --- a/content/wiki/service/camera-control/index.md +++ b/content/wiki/service/camera-control/index.md @@ -17,12 +17,14 @@ contributors: ["caitken-com", "crxporter", "itsj4y", "Shaquu"] ## Notes on Cameras -Cameras are a complicated situation. If you are running the [Docker way](https://github.com/NRCHKB/node-red-contrib-homekit-docker) then FFmpeg will be preinstalled for you with several of the options preset (may not have all hardware accelerations built). If you are on a system with `apt` (Raspberry pi, Ubuntu, Debian, etc) you can use the FFmpeg install script which is maintained by a couple of our users and designed for nrchkb users. This script is documented [here](https://github.com/marcus-j-davies/nrchkb-ffmpeg-build) and can be run at any time using this one-line terminal command then following the prompts: +Cameras require an extra install of FFmpeg for video processing. If you are on a system with `apt` (Raspberry pi, Ubuntu, Debian, etc) you can use the FFmpeg install script which is maintained by a couple of our users and designed for nrchkb. This script is documented [here](https://github.com/marcus-j-davies/nrchkb-ffmpeg-build) and can be run at any time using this one-line terminal command then following the prompts: ``` bash <(curl -sL https://raw.githubusercontent.com/marcus-j-davies/nrchkb-ffmpeg-build/main/nrchkb-ffmpeg-build.sh) ``` +If you are running our [Docker image](https://github.com/NRCHKB/node-red-contrib-homekit-docker) then FFmpeg will be preinstalled for you with several of the options preset (may not have all hardware accelerations built). + For those writing examples, please include how you have installed FFmpeg (including any special build flags)! It is recommended use "Accessory" as the Host Type for cameras. The camera should be the "parent" service with "motion" and "doorbell" (if used) as linked services. @@ -54,7 +56,7 @@ Step **zero**: I assume you are able to set up a pi zero with SSH and Wi-Fi. I a Step **one**: use `raspi-config` to enable the camera interface on the pi -Step **two**: install FFmpeg for HomeBridge using our script: +Step **two**: install FFmpeg using our script: ``` bash <(curl -sL https://raw.githubusercontent.com/marcus-j-davies/nrchkb-ffmpeg-build/main/nrchkb-ffmpeg-build.sh) From afb5698d6e79f53fc1d6aea9ea64466f2aff4a92 Mon Sep 17 00:00:00 2001 From: Tadeusz Wyrzykowski Date: Sun, 20 Feb 2022 20:00:08 +0100 Subject: [PATCH 3/6] Update index.md --- content/wiki/service/camera-control/index.md | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/content/wiki/service/camera-control/index.md b/content/wiki/service/camera-control/index.md index 00e0e1b7d..ec2eac0fd 100644 --- a/content/wiki/service/camera-control/index.md +++ b/content/wiki/service/camera-control/index.md @@ -17,7 +17,7 @@ contributors: ["caitken-com", "crxporter", "itsj4y", "Shaquu"] ## Notes on Cameras -Cameras require an extra install of FFmpeg for video processing. If you are on a system with `apt` (Raspberry pi, Ubuntu, Debian, etc) you can use the FFmpeg install script which is maintained by a couple of our users and designed for nrchkb. This script is documented [here](https://github.com/marcus-j-davies/nrchkb-ffmpeg-build) and can be run at any time using this one-line terminal command then following the prompts: +Cameras require an extra install of FFmpeg for video processing. If you are on a system with `apt` (Raspberry Pi, Ubuntu, Debian, etc.) you can use the FFmpeg install script which is maintained by a couple of our users and designed for NRCHKB. This script is documented [here](https://github.com/marcus-j-davies/nrchkb-ffmpeg-build) and can be run at any time using this one-line terminal command, then following the prompts: ``` bash <(curl -sL https://raw.githubusercontent.com/marcus-j-davies/nrchkb-ffmpeg-build/main/nrchkb-ffmpeg-build.sh) @@ -27,7 +27,7 @@ If you are running our [Docker image](https://github.com/NRCHKB/node-red-contrib For those writing examples, please include how you have installed FFmpeg (including any special build flags)! -It is recommended use "Accessory" as the Host Type for cameras. The camera should be the "parent" service with "motion" and "doorbell" (if used) as linked services. +It is recommended to use "Accessory" as the Host Type for cameras. The camera should be the Parent Service, with "Motion" and "Doorbell" (if used) as Linked Services. ### How to debug issues @@ -44,7 +44,7 @@ If you have problems with FFmpeg (if you think the camera is set up properly but ### * Raspberry Pi Zero W -Example written by CRXPorter. Date 21 November 2020, updated February, 2022. Plugin version 1.4.3, Node-RED version 2.1.5. +Example written by CRXPorter. Date 21 November 2020, updated February 2022. Plugin version 1.4.3, Node-RED version 2.1.5. Hardware:\ -Raspberry Pi Zero W\ @@ -79,26 +79,26 @@ Additional tuning could be done to optimize resolution and speed. The new Raspbe ### * Raspberry Pi Zero W running MotionEyeOS -This setup adds motion detection to the Pi Zero W camera. Note that the pi zero does not appear to have enough power to run MotionEye alongside Node-RED, so it is recommended to run MotionEyeOS alone on a pi with Node-RED on another server (bigger pi, nas, etc.). +This setup adds motion detection to the Pi Zero W camera. Note that the pi zero does not appear to have enough power to run MotionEye alongside Node-RED, so it is recommended to run MotionEyeOS alone on a pi with Node-RED on another server (bigger pi, NAS, etc.). 1. Head over to [MotionEyeOS](https://github.com/ccrisan/motioneyeos) releases and download the one for "raspberrypi", flash it to your SD card as you normally would 2. Boot and set up MotionEyeOS as you like it (motion detector settings, stream quality, etc.) using their instructions. The one important part is to send your motion alerts to a webhook, the address used in the code below is `http://:1880/MotionEye` -3. Import the flow below into your Node-RED machine, you will need to change the IP addresses in the camera node, so they point to your pi zero. +3. To import the flow below into your Node-RED machine, you will need to change the IP addresses in the camera node, so they point to your pi zero. ```json [{"id":"54eca8a5.3ae868","type":"homekit-service","z":"e9d44372.de7a58","isParent":true,"bridge":"e1aa7622.06a8b","parentService":"","name":"MotionEye OS","serviceName":"CameraControl","topic":"","filter":false,"manufacturer":"NRCHKB","model":"0.130.2","serialNo":"Default Serial Number","firmwareRev":"0.130.2","hardwareRev":"0.130.2","softwareRev":"0.130.2","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"-re -f mjpeg -i http://10.10.10.13:8081","cameraConfigStillImageSource":"-f mjpeg -i http://10.10.10.13/picture/1/current/","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":"800","cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{}","waitForSetupMsg":false,"outputs":3,"x":460,"y":1680,"wires":[[],[],[]]},{"id":"ea482940.81194","type":"http in","z":"e9d44372.de7a58","name":"MotionEye","url":"/MotionEye","method":"get","upload":false,"swaggerDoc":"","x":290,"y":1540,"wires":[["10c44307.6c37ad","6a889a0f.5f851c","a3c9a20d.a1fef8"]]},{"id":"10c44307.6c37ad","type":"debug","z":"e9d44372.de7a58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":450,"y":1500,"wires":[]},{"id":"6a889a0f.5f851c","type":"http response","z":"e9d44372.de7a58","name":"Success","statusCode":"201","headers":{},"x":750,"y":1540,"wires":[]},{"id":"5ed047ac.070648","type":"homekit-service","z":"e9d44372.de7a58","isParent":false,"bridge":"","parentService":"54eca8a5.3ae868","name":"MotionEye Motion","serviceName":"MotionSensor","topic":"","filter":false,"manufacturer":"NRCHKB","model":"0.130.2","serialNo":"Default Serial Number","firmwareRev":"0.130.2","hardwareRev":"0.130.2","softwareRev":"0.130.2","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":720,"cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{}","waitForSetupMsg":false,"outputs":2,"x":790,"y":1600,"wires":[[],[]]},{"id":"b29f3d75.196e1","type":"change","z":"e9d44372.de7a58","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.MotionDetected","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":1600,"wires":[["5ed047ac.070648"]]},{"id":"a3c9a20d.a1fef8","type":"trigger","z":"e9d44372.de7a58","name":"","op1":"true","op2":"false","op1type":"bool","op2type":"bool","duration":"30","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":370,"y":1600,"wires":[["b29f3d75.196e1"]]},{"id":"e1aa7622.06a8b","type":"homekit-bridge","bridgeName":"TestCam","pinCode":"111-11-111","port":"","allowInsecureRequest":false,"manufacturer":"NRCHKB","model":"0.130.2","serialNo":"Default Serial Number","firmwareRev":"0.130.2","hardwareRev":"0.130.2","softwareRev":"0.130.2","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":true}] ``` -### * Unifi Protect +### * UniFi Protect Example written by CRXPorter.\ Cameras tested: -- Unifi G3 Flex -- Unifi G3 Bullet -- Unifi G4 Doorbell +- UniFi G3 Flex +- UniFi G3 Bullet +- UniFi G4 Doorbell -Motion detection and doorbell presses are available for advanced users, ask @crxporter on discord. A new Unifi node is in active development, check [here](https://github.com/NRCHKB/node-red-contrib-unifi-os) for that project. +Motion detection and doorbell presses are available for advanced users, ask @crxporter on discord. A new UniFi node is in active development, check [here](https://github.com/NRCHKB/node-red-contrib-unifi-os) for that project. FFmpeg was installed on a pi 4. Node-RED was installed with the official Node-RED on pi install script. @@ -112,7 +112,7 @@ bash <(curl -sL https://raw.githubusercontent.com/marcus-j-davies/nrchkb-ffmpeg- #### Cameras Setup -The camera node setup is quite simple for Unifi. Be sure to enable unauthenticated still images on your cameras. My fields are filled out as shown: +The camera node setup is quite simple for UniFi. Be sure to enable unauthenticated still images on your cameras. My fields are filled out as shown: ```yaml Video Processor: ffmpeg @@ -141,7 +141,7 @@ This is a work in progress. Updated 18 February 2022. Please find me (crxporter) Replace XXX with your camera's password. Do not use Video Filter with copy codec. -There may be more ideal settings but these should get you up and running. +There may be more ideal settings, but these should get you up and running. ```yaml Video Processor: ffmpeg From 338a4a915b40c9d51a97baa1270d97206aa9e238 Mon Sep 17 00:00:00 2001 From: Tadeusz Wyrzykowski Date: Sun, 20 Feb 2022 20:02:23 +0100 Subject: [PATCH 4/6] Update index.md --- content/wiki/service/camera-control/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/wiki/service/camera-control/index.md b/content/wiki/service/camera-control/index.md index ec2eac0fd..0803be123 100644 --- a/content/wiki/service/camera-control/index.md +++ b/content/wiki/service/camera-control/index.md @@ -19,7 +19,7 @@ contributors: ["caitken-com", "crxporter", "itsj4y", "Shaquu"] Cameras require an extra install of FFmpeg for video processing. If you are on a system with `apt` (Raspberry Pi, Ubuntu, Debian, etc.) you can use the FFmpeg install script which is maintained by a couple of our users and designed for NRCHKB. This script is documented [here](https://github.com/marcus-j-davies/nrchkb-ffmpeg-build) and can be run at any time using this one-line terminal command, then following the prompts: -``` +```bash bash <(curl -sL https://raw.githubusercontent.com/marcus-j-davies/nrchkb-ffmpeg-build/main/nrchkb-ffmpeg-build.sh) ``` @@ -58,7 +58,7 @@ Step **one**: use `raspi-config` to enable the camera interface on the pi Step **two**: install FFmpeg using our script: -``` +```bash bash <(curl -sL https://raw.githubusercontent.com/marcus-j-davies/nrchkb-ffmpeg-build/main/nrchkb-ffmpeg-build.sh) ``` From a3cb81ec1bfbd9fc833db035dbc508f17c01afee Mon Sep 17 00:00:00 2001 From: Tadeusz Wyrzykowski Date: Sun, 20 Feb 2022 20:08:46 +0100 Subject: [PATCH 5/6] More changes --- content/wiki/service/camera-control/index.md | 29 +++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/content/wiki/service/camera-control/index.md b/content/wiki/service/camera-control/index.md index 0803be123..16445f542 100644 --- a/content/wiki/service/camera-control/index.md +++ b/content/wiki/service/camera-control/index.md @@ -17,7 +17,9 @@ contributors: ["caitken-com", "crxporter", "itsj4y", "Shaquu"] ## Notes on Cameras -Cameras require an extra install of FFmpeg for video processing. If you are on a system with `apt` (Raspberry Pi, Ubuntu, Debian, etc.) you can use the FFmpeg install script which is maintained by a couple of our users and designed for NRCHKB. This script is documented [here](https://github.com/marcus-j-davies/nrchkb-ffmpeg-build) and can be run at any time using this one-line terminal command, then following the prompts: +Cameras require an extra install of FFmpeg for video processing. +If you are on a system with `apt` (Raspberry Pi, Ubuntu, Debian, etc.) you can use the FFmpeg install script, which is maintained by a couple of our users and designed for NRCHKB. +This script is documented [here](https://github.com/marcus-j-davies/nrchkb-ffmpeg-build) and can be run at any time using this one-line terminal command, then after the prompts: ```bash bash <(curl -sL https://raw.githubusercontent.com/marcus-j-davies/nrchkb-ffmpeg-build/main/nrchkb-ffmpeg-build.sh) @@ -27,11 +29,12 @@ If you are running our [Docker image](https://github.com/NRCHKB/node-red-contrib For those writing examples, please include how you have installed FFmpeg (including any special build flags)! -It is recommended to use "Accessory" as the Host Type for cameras. The camera should be the Parent Service, with "Motion" and "Doorbell" (if used) as Linked Services. +It is recommended to use "Accessory" as the Host Type for cameras. +The camera should be the Parent Service, with "Motion" and "Doorbell" (if used) as Linked Services. ### How to debug issues -If you have problems with FFmpeg (if you think the camera is set up properly but it "does nothing" then you might have FFmpeg problems) then please follow these steps to properly debug your FFmpeg setup. +If you have problems with FFmpeg (if you think the camera is set up properly, but it "does nothing" then you might have FFmpeg problems) then please follow these steps to properly debug your FFmpeg setup. - Configure Camera Control node in Node-RED - Run Node-RED with `DEBUG=NRCHKB*,CameraSource*` and tick "debug mode" in Camera Control @@ -46,7 +49,8 @@ If you have problems with FFmpeg (if you think the camera is set up properly but Example written by CRXPorter. Date 21 November 2020, updated February 2022. Plugin version 1.4.3, Node-RED version 2.1.5. -Hardware:\ +Hardware: + -Raspberry Pi Zero W\ -Raspberry Pi Camera Module V2\ @@ -75,13 +79,17 @@ Step **five**: import this flow. It should be a single homekit node Step **six**: add it to your Home.app and enjoy! Notes:\ -Additional tuning could be done to optimize resolution and speed. The new Raspberry Pi High Quality camera should work with the same setup. This setup should work on a Pi 3 or 4 with very little modification. Adding a microphone, motion detector, doorbell button, or other things should be relatively simple. Visit us [on discord](https://discord.gg/uvYac5u) if you'd like to discuss! +Additional tuning could be done to optimize resolution and speed. +The new Raspberry Pi High Quality camera should work with the same setup. +This setup should work on a Pi 3 or 4 with very little modification. +Adding a microphone, motion detector, doorbell button, or other things should be relatively simple. +Visit us [on discord](https://discord.gg/uvYac5u) if you'd like to discuss! ### * Raspberry Pi Zero W running MotionEyeOS This setup adds motion detection to the Pi Zero W camera. Note that the pi zero does not appear to have enough power to run MotionEye alongside Node-RED, so it is recommended to run MotionEyeOS alone on a pi with Node-RED on another server (bigger pi, NAS, etc.). -1. Head over to [MotionEyeOS](https://github.com/ccrisan/motioneyeos) releases and download the one for "raspberrypi", flash it to your SD card as you normally would +1. Head over to [MotionEyeOS](https://github.com/ccrisan/motioneyeos) releases and download the one for "raspberrypi", flash it to your SD card as you normally would. 2. Boot and set up MotionEyeOS as you like it (motion detector settings, stream quality, etc.) using their instructions. The one important part is to send your motion alerts to a webhook, the address used in the code below is `http://:1880/MotionEye` 3. To import the flow below into your Node-RED machine, you will need to change the IP addresses in the camera node, so they point to your pi zero. @@ -98,15 +106,16 @@ Cameras tested: - UniFi G3 Bullet - UniFi G4 Doorbell -Motion detection and doorbell presses are available for advanced users, ask @crxporter on discord. A new UniFi node is in active development, check [here](https://github.com/NRCHKB/node-red-contrib-unifi-os) for that project. +Motion detection and doorbell presses are available for advanced users, ask @crxporter on discord. +A new UniFi node is in active development, check [here](https://github.com/NRCHKB/node-red-contrib-unifi-os) for that project. -FFmpeg was installed on a pi 4. Node-RED was installed with the official Node-RED on pi install script. +FFmpeg was installed on a pi 4. Node-RED was installed with the official Node-RED on a PI install script. #### FFmpeg Install Just run the `nrchkb-ffmpeg-build` script found here: -``` +```bash bash <(curl -sL https://raw.githubusercontent.com/marcus-j-davies/nrchkb-ffmpeg-build/main/nrchkb-ffmpeg-build.sh) ``` @@ -129,7 +138,7 @@ Audio: yes Packet Sixe: 564 Map Video: 0:v Map Audio: 0:a -Video Filter: +Video Filter: Additional Command Line: -preset slow -profile:v high -level 4.2 -x264-params intra-refresh=1:bframes=0 ``` From 3a390fc4f62e4b11c3f5320075eef766f12d2db0 Mon Sep 17 00:00:00 2001 From: Tadeusz Wyrzykowski Date: Sat, 12 Mar 2022 19:35:41 +0100 Subject: [PATCH 6/6] Update index.md --- content/wiki/service/camera-control/index.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/content/wiki/service/camera-control/index.md b/content/wiki/service/camera-control/index.md index 16445f542..fb8e91ec8 100644 --- a/content/wiki/service/camera-control/index.md +++ b/content/wiki/service/camera-control/index.md @@ -3,7 +3,6 @@ title: "Camera Control" description: "Camera Control" lead: "" date: 2021-04-17T18:50:12.026Z -lastmod: 2022-02-18T22:06:22.437Z draft: false images: [] menu: @@ -12,7 +11,6 @@ menu: toc: true service: name: "CameraControl" -contributors: ["caitken-com", "crxporter", "itsj4y", "Shaquu"] --- ## Notes on Cameras