Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
homebridge-camera-ui
Advanced tools
Creating and maintaining Homebridge plugins consume a lot of time and effort, if you would like to share your appreciation, feel free to "Star" or donate.
This is a dynamic platform plugin for Homebridge to control your RTSP Cameras with MQTT (motion), FTP (motion), GUI (Access to stream via http), Telegram notification and FakeGato Support.
This Plugin creates one accessory with two services. A camera service to access your camera via RTSP and a Motion Sensor service with FakeGato functionality to check the last movement and more. It creates also some custom characteristics to switch camera settings, eg SSH, FTP, Telnet etc within 3rd party apps like Elgato EVE. (Custom Characteristics only for YI Cameras with YI-HACK v4)
You can also set up the notifier to get a Telegram notification with customized messages and markdown capability when motion detected/undetected.
Last but not least, you can activate "GUI" to access the Stream via webbrowser on any device! On iOS devices you have also the possibility to save the website as a web application to your home screen.
See the changelog for changes between versions of this package.
After Homebridge has been installed:
(sudo) npm i -g homebridge-camera-ui@latest
You also need a programm to handle the stream. I recommend to use FFmpeg
See OS instructions for detailed installation instruction regarding to your OS
{
"bridge": {
...
},
"accessories": [
...
],
"platforms": [
{
"platform": "CameraUI",
"videoProcessor": "ffmpeg",
"cameras": [
{
"name": "Flur",
"active": true,
"videoConfig": {
"source": "-rtsp_transport tcp -re -i rtsp://192.168.178.31/ch0_0.h264",
"maxWidth": 1920,
"maxHeight": 1080,
"maxFPS": 30
}
}
]
}
]
}
See Example Config for more details and options!
This plugin offers two possibilities to get movement detection on your camera. MQTT and FTP.
For MQTT, the camera need to have this capability, otherwise it is not possible to use MQTT for movement detection. The plugin listen to the server for the start and stop message setted up in config.json.
For FTP, the camera need to have the capability to upload images to a FTP server by movement detection. If your camera has this ability, the plugin can scan the folder where the images are uploaded. The plugin compare all images and take the latest uploaded image and use the timestamp for movement detection. (Only if the latest image is newer than the image before stored in accessory cache). You can also set up a "duration" to hold the "movement detected" state.
{
"bridge": {
...
},
"accessories": [
...
],
"platforms": [
{
"platform": "CameraUI",
"videoProcessor": "ffmpeg",
"cameras": [
{
"name": "Flur",
"active": true,
"videoConfig": {
"source": "-rtsp_transport tcp -re -i rtsp://192.168.178.31/ch0_0.h264",
"maxWidth": 1920,
"maxHeight": 1080,
"maxFPS": 30
},
"mqtt": {
"active": true,
"host": "192.168.178.123",
"port": 1883,
"username": "",
"password": "",
"topicPrefix": "yicam",
"topicSuffix": "motion",
"startMessage": "motion_start",
"stopMessage": "motion_stop",
"recordOnMovement": true,
"recordVideoSize": 30
}
}
]
}
]
}
{
"bridge": {
...
},
"accessories": [
...
],
"platforms": [
{
"platform": "CameraUI",
"videoProcessor": "ffmpeg",
"cameras": [
{
"name": "Flur",
"active": true,
"videoConfig": {
"source": "-rtsp_transport tcp -re -i rtsp://192.168.178.31/ch0_0.h264",
"maxWidth": 1920,
"maxHeight": 1080,
"maxFPS": 30
},
"ftp":{
"active":true,
"host":"192.168.178.1",
"username":"MyUsername",
"password":"MyPassword",
"secure":false,
"absolutePath":"Recordings",
"movementDuration":20,
"recordOnMovement": true,
"recordVideoSize": 30
}
}
]
}
]
}
See Example Config for more details and options!
After setting up the gui part in config.json, just open http://localhost:<port_config.json>
and you are ready. Credentials are these setted up in config.json as username and password. (Maybe you need to replace localhost with the ip address where the plugin/homebridge runs)
You don't need to "activate" the camera(s) if you want only access the camera over GUI.
{
"bridge": {
...
},
"accessories": [
...
],
"platforms": [
{
"platform": "CameraUI",
"videoProcessor": "ffmpeg",
"cameras": [
{
"name": "Flur",
"active": true,
"videoConfig": {
"source": "-rtsp_transport tcp -re -i rtsp://192.168.178.31/ch0_0.h264",
"maxWidth": 1920,
"maxHeight": 1080,
"maxFPS": 30
}
}
],
"gui": {
"active": true,
"username": "MyUsername",
"password": "MySuperSecretPassword",
"port": 3000,
"wsport": 8100
}
}
]
}
See Example Config for more details and options!
For YI Cameras with YI-HACK-V4 this plugin offers custom characteristics and a "settings" page where you can change some settings like Enable/Disable SSH, FTP, Telnet etc. To use this, u need to pass "yihackv4" into your config.json, ie.
{
"bridge": {
...
},
"accessories": [
...
],
"platforms": [
{
"platform": "CameraUI",
"debug": false,
"videoProcessor": "ffmpeg",
"cameras": [
{
"name": "Flur",
"active": true,
"yihackv4": true,
"videoConfig": {
"source": "-rtsp_transport tcp -re -i rtsp://192.168.178.31/ch0_0.h264",
"maxWidth": 1920,
"maxHeight": 1080,
"maxFPS": 30
}
}
]
}
]
}
http://localhost:<port_config.json>
In regarding to movement detection, this pluggin offers also a notification system via Telegram. You can set up movement detection/no movement in config.json. This plugin sends also captured images/videos (if setted up in config.json) via Telegram.
It supports also markdown
*bold text*
_italic text_
[inline URL](http://www.example.com/)
[inline mention of a user](tg://user?id=123456789)
`inline fixed-width code`
block_language
pre-formatted fixed-width code block
{
"bridge": {
...
},
"accessories": [
...
],
"platforms": [
{
"platform": "CameraUI",
"videoProcessor": "ffmpeg",
"cameras": [
{
"name": "Flur",
"active": true,
"videoConfig": {
"source": "-rtsp_transport tcp -re -i rtsp://192.168.178.31/ch0_0.h264",
"maxWidth": 1920,
"maxHeight": 1080,
"maxFPS": 30
},
"mqtt": {
"active": true,
"host": "192.168.178.123",
"port": 1883,
"username": "",
"password": "",
"topicPrefix": "yicam",
"topicSuffix": "motion",
"startMessage": "motion_start",
"stopMessage": "motion_stop",
"recordOnMovement": true,
"recordVideoSize": 30
}
}
],
"notifier":{
"active":true,
"token":"TelegramToken",
"chatID":"TelegramChatID",
"motion_start":"Motion *detected*",
"motion_stop":"*No* motion",
"interval":0
}
}
]
}
To install this utility on OS X, just head over to ffmpeg.org, download the release relative to your Macs architecture. Then put the application into an accessible directory and run it from command line. Another way is using HomeBrew
For example
brew install ffmpeg --with-fdk-aac --with-ffplay --with-libass --with-libvorbis --with-libvpx --with-rtmpdump --with-openh264 --with-tools
To install this utility on Windows, head over to ffmpeg.org and follow the download link, using your architecture. Then place the downloaded software into an accessible directory and run from command line.
To install this utility on Unix, just follow the instructions found at ffmpeg.org
To check if ffmpeg is installed correctly and see a list of available commands try running the following command in the command line:
ffmpeg -help
Homebridge Docker:
Add FFmpeg to packages
PACKAGES=ffmpeg
There are a few factors involved. To know why the stream arrives delayed or choppy, the following points should be considered.
What kind of system is it?
It seems, the slower the system, the slower the stream
If it runs on a weak system like Raspi, what could you do to reduce the required processing power of FFMPEG?
For example, you could lower the resolution here, make bitrate (maxBitrate) less, define rtsp transport (-rtsp_transport), change packet size (packetSize> multiplier x188) etc
What to do if that does not help and the picture still stops or is greatly delayed?
See if the stream is running well on eg VLC. If, for example, everything is good on VLC then it depends mostly because the processing power is much larger. If the stream also delayed or choppy on eg VLC, then you should try to fix the camera
This plugin has been verified to work with the following apps on iOS 12/13:
This plugin uses a modified version of the homebridge-camera-ffmpeg plugin from @KhaosT
Credits goes also to @phoboslab for the wonderful decoder AND @TheCrypt0 for the awesome hack!
You can contribute to this homebridge plugin in following ways:
Pull requests are accepted.
If you have any issues with the plugin then you can run this plugin in debug mode, which will provide some additional information. This might be useful for debugging issues. Just open your config.json and set debug to true!
MIT License
Copyright (c) 2019 Seyit Bayraktar
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
User Interface for RTSP capable cameras with HSV support.
The npm package homebridge-camera-ui receives a total of 172 weekly downloads. As such, homebridge-camera-ui popularity was classified as not popular.
We found that homebridge-camera-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.