Code Monkey home page Code Monkey logo

homebridge-camera-ffmpeg-ufv's Introduction

homebridge-camera-ffmpeg-ufv

UniFi Video plugin for Homebridge, based on homebridge-camera-ffmpeg

This plugin connects your UniFi Video cameras to HomeKit via your UniFi Video NVR.

It automatically finds the RTSP-enabled cameras on the NVR. It then uses ffmpeg to convert the video streams from the NVR into the format HomeKit requires.

The NVR API is undocumented and unsupported. It is subject to change at any time. Use at your own risk.

Requirements

  • The UniFi Video NVR is required. This plugin was developed and tested against UFV NVR version 3.7.1.
  • Cameras must have at least one "RTSP Service" enabled. The plugin uses the highest-quality stream enabled for the camera.
  • At least one user must have an API key, and "API Usage" must be turned on.
  • The API port and the RTSP port must be open on the NVR system's firewall, if applicable. The API port is probably 7080 (http) or 7443 (https), and your RTSP port is probably 7447. You can confirm these in your UniFi NVR configuration.
  • Homebridge is required. This guide assumes you have homebridge working.
  • The system running homebridge must have ffmpeg and the node ffmpeg module installed.

Install

  1. Install ffmpeg on your homebridge system, if necessary, as via your system's package manager.
  2. Install the ffmpeg npm module on your homebridge system, if necessary: sudo npm install -g ffmpeg
  3. Install this plugin: sudo npm install -g homebridge-camera-ffmpeg-ufv

Configure UniFi Video

  1. Log in to your NVR's web GUI.
  2. Under Cameras > (camera) > Video > RTSP service, turn on RTSP for each camera you want to make available to HomeKit. This plugin will use the highest quality stream that you enable. Note that whatever you choose will be converted to at least 720p at 15 fps, as required by HomeKit.
  3. Under Users > (user) > API Access, turn on "Allow API Usage" and make note of your API key.
  4. On the main settings page, scroll to the "Streaming Ports" section and make sure RTSP is turned on.

Configure Homebridge

On your homebridge system, edit config.json to add a platform block like this:

{
  "platform": "camera-ffmpeg-ufv",
  "name": "UniFi Video (ffmpeg)",
  "nvrs": [
    {
      "apiHost": "nvr-ip-or-hostname.example.com",
      "apiPort": 7443,
      "apiProtocol": "https",
      "apiKey": "<api key from NVR user settings>",
      "motionSensors": true
    }
  ]
}
  • apiHost is the IP address or hostname of your NVR.
  • apiPort is the port your admin portal is listening on, usually 7080 or 7443.
  • apiProtocol is either http or https.
  • apiKey is the API key you noted earlier.
  • motionSensors (optional) lets you disable motion sensors from the homebridge plugin. Must equal false to disable.

Start or restart homebridge to update the configuration.

Add cameras to your HomeKit home

HomeKit requires you to add each camera individually. Use the code displayed on the console by homebridge when it starts up.

  1. On your iOS device, in the Home app, tap the plus sign in the top right corner, then tap "Add Accessory…"
  2. Tap on one of the discovered cameras.
  3. Acknowledge the warning that this accessory is unsupported.
  4. Tap "Enter code manually" and enter the code from the homebridge console.
  5. Set your preferences for this camera, then tap "Done."

Known issues

HTTPS is supported, but we ignore the error caused by NVR's built-in self-signed certificate. This is not secure, and we should handle it better once the NVR supports real certificates.

Raspberry Pi users require a different build of ffmpeg with omx enabled for best results.

This plugin recognizes only the first server configured for an NVR. The UniFi Video API can describe multiple servers per NVR, but it does not seem to identify the server that corresponds to a given camera. The UniFi Video NVR software does not officially support multiple servers. If you're using the unsupported configuration for this, let's talk.

The live stream is delayed by a few seconds while ffmpeg starts the stream client, starts transcoding, and sets up the encryption HomeKit requires. Can this be optimized? Probably.

It doesn't strictly use the highest-quality stream available; rather, it uses the first channel in the array returned by the API. So far, they appear to come back in descending order of quality, so the first one in the array should be the best stream.

Cameras are discovered only when Homebridge starts up. If you add or remove cameras, you will need to restart Homebridge.

Debugging

This plugin uses the debug module. To see debugging output, run homebridge with a DEBUG env var set:

$ DEBUG=* homebridge # Show debugging output for all modules
$ DEBUG=camera-ffmpeg-ufv homebridge # Show debugging output for this module only

Notes

I'm calling it camera-ffmpeg-ufv. 'ffmpeg' is in the name because, while there may be many approaches to this, this one uses ffmpeg. 'ufv' is in the name because 'homebridge-camera-ffmpeg-unifi-video' starts getting lengthy, and besides, I don't want to use 'unifi' in the name and have anyone thinking UBNT is officially providing this plugin. This is not a Ubiquiti product.

Wish list

  • Two-way audio
  • Security system service for motion detection
  • Camera details (manufacturer, model, serial number)
  • Refactor the ufv class to make better use of methods and promises

homebridge-camera-ffmpeg-ufv's People

Contributors

adrum avatar ay avatar cburn avatar cflurin avatar gozoinks avatar jmbcpi avatar jmbwell avatar khaost avatar northernman54 avatar sphtkr avatar wsmckenz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-camera-ffmpeg-ufv's Issues

Change length of motion after detection

Hello there,

My motion stays on for 5 minutes after detection. how can we change this?
maybe in the config?
add a value for reset?
after 30 seconds perhaps?

Thanks in advance
REG10

Sensors all went unresponsive in Homekit

0|homebrid | at Server.listen (net.js:1480:7)
0|homebrid | at EventedHTTPServer.listen (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:60:19)
0|homebrid | at HAPServer.listen (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:158:20)
0|homebrid | at Bridge.Accessory.publish (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:607:16)
0|homebrid | at Server._publish (/usr/lib/node_modules/homebridge/lib/server.js:128:16)
0|homebrid | at Server. (/usr/lib/node_modules/homebridge/lib/server.js:404:14)
0|homebrid | at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:16:19
0|homebrid | at IncomingMessage. (/usr/lib/node_modules/homebridge-camera-ffmpeg-ufv/index.js:230:11)
0|homebrid | at emitNone (events.js:111:20)
0|homebrid | at IncomingMessage.emit (events.js:208:7)
0|homebrid | at endReadableNT (_stream_readable.js:1064:12)
0|homebrid | at args.(anonymous function) (/usr/lib/node_modules/pm2/node_modules/event-loop-inspector/index.js:133:29)
0|homebrid | at _combinedTickCallback (internal/process/next_tick.js:138:11)
0|homebrid | at process._tickDomainCallback (internal/process/next_tick.js:218:9)
0|homebrid | HAP Warning: Characteristic 00000079-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 00000080-0000-1000-8000-0026BB765291. Adding anyway.

FFMPEG with h264_omx Option

I could never get streaming working on Hassio, but easily got it working on a Raspbian Stretch install.

The live video starts to lag and eventually drops out on my Pi3 with FFMPEG OMX installed. Is there an option we can pass in the JSON that will force the h264_omx vcodec to be used? That codec is hardware accelerated on the Pi. I think this is what they use for homebridge-camera-ffmpeg-omx.

Thanks for all your work. This is a great plugin.

Integration with Unifi Protect

Since Unifi is looking no move to its new Unifi Protect application as its NVR, do you have plans to integrate with that as well?

Push Notifications no longer include image in iOS 13

Are others experiencing this as well? I’ve upgraded to iOS 13 and also upgraded all Homebridge plugins but notifications no longer include images.

Needless to say, thank you for this great plugin! Just wanted to report the issue to confirm that I’m not just missing something that I might need to update.

Missing Camera

Hello, thank you for this plugin for home bridge! It’s awesome!

I was wondering if anyone else was having issues adding ALL cameras to the Home app? For example I have 6 cameras on a NVR and the home bridge log shows 6 published, but when I go through the process to add accessories, there are only 5. I’ve added all the cameras I can but the last one is just not showing up.

Any ideas?

Thanks in advance!

3.9.7 still work?

Hello,
I just tried setting this up and it seems homebridge is working; however, after adding this plugin and setting up config.json... it does nothing. I do not see any cameras when trying to add accessories... and when booting homebridge, I do not see it say anything about find cameras... I can see where it loads the plug in

pi@raspberrypi:~ $ DEBUG=camera-ffmpeg-ufv homebridge -D
[2018-7-3 00:40:34] Loaded config.json with 0 accessories and 0 platforms.
[2018-7-3 00:40:34] ---
[2018-7-3 00:40:34] Loaded plugin: homebridge-camera-ffmpeg-ufv
[2018-7-3 00:40:34] Registering platform 'homebridge-camera-ffmpeg-ufv.camera-ffmpeg-ufv'
[2018-7-3 00:40:34] ---
Load homebridge-camera-ffmpeg-ufv.camera-ffmpeg-ufv
Setup Payload:...

and that's all i can see other than the QR Code and manual code... says homebridge is running on port.....

Not sure what else to try? running on a raspberry pi 2. I compiled FFmpeg to work with OMX. thanks for any help! (not sure if it's an issue or not as never had a working version... so may be UFV 3.9.7)

Only getting sensors no camera feed

Hi,

On camera-ffmpeg-ufv v0.6.0 i use to get the camera feed and no motion sensors. I moved to a docker version of homebridge, included the ffmpeg package and upgraded the package to 0.8.0 and now i only get sensor accessories no camera feed.

See log below. Great plugin btw, really excited about motion sensor capability.

[2018-7-7 19:29:58] [UniFi Video (ffmpeg)] Initializing camera-ffmpeg-ufv platform...
...
Load homebridge-camera-ffmpeg-ufv.camera-ffmpeg-ufv
...
[2018-7-7 19:29:58] [UniFi Video (ffmpeg)] Published 2 camera accessories.
[2018-7-7 19:29:58] [UniFi Video (ffmpeg)] Initializing platform accessory 'X1 Motion Sensor'...
[2018-7-7 19:29:58] [UniFi Video (ffmpeg)] Initializing platform accessory 'X2 Motion Sensor'...

Oh, I might add that i am still running the other homebridge installation on the same machine, not in docker though, might that have something to do with it?

Remote viewing - No Response

First off, thank you for your work on this. It was very easy to set up. I have a similar problem to the recent issue post, but I thought I would make a new post. I can reliably see my two G3 Unifi cameras when I am on my home network, but when I am outside of my network the thumbnail doesn't update and the streams show as "No Response."

I also have an Arlo camera that I use inside my home that has built in homekit support. This camera works great inside or outside my network.

Any ideas on what I can try to make my G3 Unifi cameras show remotely?

Thanks in advance!

Stuck at Load homebridge-camera-ffmpeg-ufv.camera-ffmpeg-ufv

Hello,

I am trying to setup homebridge-camera-ffmpeg-ufv with my NVR.

My setup is exactly as described in the readme, but I have two IPs for the NVR, and thus two RTSP streams per camera. This may be why the plugin is having issues. My cameras live on 10.0.50.x and my NVR lives at 10.0.50.15 and 10.0.1.61.

My Homebridge server lives at 10.0.1.211 and cannot see 10.0.50.15, but can see 10.0.1.61. However, first listed for each camera is: rtsp://10.0.50.15:7447/"cameraID"e_0 which Homebridge can't reach. Second listed for each camera is rtsp://10.0.1.61:7447/"cameraID"e_0

Homebridge just sits forever at:
[8/9/2018, 12:03:03 AM] [Unifi Video (ffmpeg)] Initializing camera-ffmpeg-ufv platform... Load homebridge-camera-ffmpeg-ufv.camera-ffmpeg-ufv
Any help would be greatly appreciated.

Config.json is:
`{
"bridge": {
"name": "Homebridge",
"username": "",
"port": 51826,
"pin": "
"
},
"platforms": [
{
"platform" : "camera-ffmpeg-ufv",
"name" : "Unifi Video (ffmpeg)",
"nvrs" : [
{
"apiHost": "10.0.1.61",
"apiPort": 7447,
"apiProtocol": "https",
"apiKey": "*"
}]
}]}

`

Cant get stream to work

Hello. I am having trouble getting the stream to work. Snap works but the stream doesnt.

From homebridge:

-rtsp_transport http -re -i rtsp://192.168.2.147:7447/5bafe117e818a74cbf741f72_0?apiKey=****************************************-threads 0 -vcodec libx264 -an -pix_fmt yuv420p -r 15 -f rawvideo -tune zerolatency -vf scale=1280:720 -b:v 299k -bufsize 299k -payload_type 99 -ssrc 677713 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params 8IyMo91nDuQo1Hh0EKWcjER0wRN21F2vBxw3Bd/o srtp://192.168.2.11:57862?rtcpport=57862&localrtcpport=57862&pkt_size=1378

macOS + watchOS

The video stream works fine for me on iOS, but will timeout on macOS and watchOS. I have also tried this PR #37 - but had the same issues. I'm running homebridge on an 10-core iMac Pro.

After enabling FFmpeg logs, macOS always has the following error:


srtp://192.168.1.79:51423?rtcpport=51423&localrtcpport=51423&pkt_size=1378: Input/output error```

watchOS appears to work, but still timeout on device.

Has anyone been able to get it to work with either device?

Do I need to port forward each cameras port for remote viewing?

I am able to get my 3 Unifi Ubiquiti Cameras working from inside my network no problem, but I have been running into issues with remote access where the feed times out frequently, but not always, when the cell connection is solid. I see that after HomeBridge is finished booting up, it lists the ports the individual cameras are running on. Do I need to port forward each of those ports too? Currently, Homebridge seems to be configured to use UPNP for the cameras which I'm guessing may be getting blocked by my firewall, as the ports change with every reboot of HomeBridge running on a Synology DiskStation? If I do need to port forward each camera's port listed in the Homebridge startup, for access to the feeds from outside the home, how do I set home bridge to only use a single specific port for that specific camera, so it doesn't change with every reboot? Currently, I am port forwarding the normal UniFi NVR ports for https access, and the API port as well, just for reference. Thank you very much!!!

Error: spawn ffmpeg ENOENT

Hi! Thank you for this wonderful plugin. I just tried installing it the cameras show up!

However, whenever I try to access a stream, homebridge crashes and reboots. The error is as follows:
Error: spawn ffmpeg ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:81:21)

It seems this means that ffmpeg hasn't been found, but I've installed it per your instructions:
npm install -g ffmpeg

I can also confirm that ffmpeg exists in the npm/node_modules/ffmpeg directory.

I'm running node.js on a windows 10 machine. Perhaps there's some issue there? Please advise. Thank you!!

iOS 13 Ready?

Anybody know if this plugin is good to go for iOS 13? I really like this plugin and it would be a real shame for it to be broken we updating to iOS 13. Has anybody tried the iOS 13 beta with this?

IR Led state?

Any chance we can create a light sensor with artificial values triggered by IR LED status?

black preview screen

as I installed it the video stream showed up a kind of "last seen picture" and refeshed after a few seconds.
now the preview stays black until I click on it and wait for the live stream 5-10s.
any idea?

API Key

Good day.

Can you please explain why/how the NVR API is required? Would it not be possible to connect using just the RTSP URL?

B

Live Streaming

Was hoping this supports live stream. It streams in the Unifi Video iOS app so I know streaming is active. I get an error when you click on the camera thumbnail it generates when you open home app for live streaming. "No Response This camera is not responding". I found out that the homebridge service is crashing when I click on the video. I've included the debug log for it.

My config below.

{
"bridge": {
"name": "Defconn",
"username": "redacted",
"port": 51826,
"pin": "redacted"
},
"accessories": [{
"accessory": "Onkyo",
"name": "Stereo",
"ip_address": "192.168.29.141",
"model": "TX-NR1009",
"poll_status_interval": "900",
"default_input": "net",
"default_volume": "10",
"max_volume": "35",
"map_volume_100": true
}],
"platforms": [{
"platform": "SmartThings",
"name": "SmartThings",
"app_url": "https://graph-na04-useast2.api.smartthings.com:443/api/smartapps/installations/",
"app_id": "f29b1c0e-36bf-4502-9fbd-2decbfffc571",
"access_token": "redacted",
"polling_seconds": 3600,
"update_method": "direct",
"direct_ip": "192.168.29.137",
"direct_port": 8000,
"api_seconds": 30
},
{
"platform": "camera-ffmpeg-ufv",
"name": "UniFi Video",
"nvrs": [{
"apiHost": "192.168.29.172",
"apiPort": 7443,
"apiProtocol": "https",
"apiKey": "redacted"
}]
}
]
}

No live stream

Just did a fresh install into Ubuntu 18.04. I've added everything according to the instructions and I'm not seeing live video. The thumbnails work ok in Home and they update every 10s, but the live stream dies with "No Response". Turned on debug and I'm not seeing anything that looks bad. I've tried it on and off the network. Removed and added the camera every time. What info do you need to see?

Error parsing JSON

I receive the following errors and no cameras are detected:

homebridge_1 | Sat, 27 Jan 2018 01:15:15 GMT camera-ffmpeg-ufv Discovered NVR Victoria Court homebridge_1 | Sat, 27 Jan 2018 01:15:15 GMT camera-ffmpeg-ufv Error parsing JSON! TypeError: Cannot read property 'forEach' of undefined

I'm on NVR version 3.9.0

I'll probably dig into the code and find the URI to grab the JSON, which I assume should be the list of video feeds.

"Published 2 camera accessories" that I can't find anywhere?

Hardware: RPi Zero W
Software: HOOBS

The plugin appears to connect to the NVR and discover the cameras well enough, but they never appear in the accessories list? ffmpeg and node-ffmpeg appear to have installed correctly. Any ideas?

[Homebridge] [2/1/2020, 3:17:58 AM] Got SIGINT, shutting down service...
[Homebridge] [2/1/2020, 3:18:02 AM] Loaded config.json with 1 accessories and 1 platforms.
[Homebridge] [2/1/2020, 3:18:04 AM] Loaded plugin: "homebridge-camera-ffmpeg-ufv"
[Homebridge] [2/1/2020, 3:18:04 AM] Registering platform "homebridge-camera-ffmpeg-ufv.camera-ffmpeg-ufv"
[Homebridge] [2/1/2020, 3:18:08 AM] Loaded plugin: "homebridge-mi-gateway"
[Homebridge] [2/1/2020, 3:18:08 AM] Registering accessory "homebridge-mi-gateway.MiGateway"
[Homebridge] [2/1/2020, 3:18:08 AM] Loaded plugin: "homebridge-mi-outlet"
[Homebridge] [2/1/2020, 3:18:08 AM] Loading 1 platforms...
[Homebridge] [2/1/2020, 3:18:08 AM] [UniFi Video (ffmpeg)] Initializing camera-ffmpeg-ufv platform...
[Homebridge] [2/1/2020, 3:18:08 AM] Loading 1 accessories...
[Homebridge] [2/1/2020, 3:18:08 AM] [MiGateway] Initializing MiGateway accessory...
[Homebridge] [2/1/2020, 3:18:09 AM] Load homebridge-camera-ffmpeg-ufv.camera-ffmpeg-ufv
[Homebridge] [2/1/2020, 3:18:09 AM] API launched
[Homebridge] [2/1/2020, 3:18:09 AM] [UniFi Video (ffmpeg)] Published 2 camera accessories.
[Homebridge] [2/1/2020, 3:18:09 AM] [Driveway] is running on port 45141.
[Homebridge] [2/1/2020, 3:18:09 AM] [Front Door] is running on port 45445.
[Homebridge] [2/1/2020, 3:18:09 AM] Service is running on port 51826.

Cannot read property 'length' of null

Hello! I had such a problem with the plugin:

camera-ffmpeg-ufv Discovered NVR NVR +0ms camera-ffmpeg-ufv Discovered server NVR +0ms camera-ffmpeg-ufv Discovered RTSP enabled camera ff9a244d-6090-3e7b-b703-e323810c8fc8 +1ms camera-ffmpeg-ufv Config: {"source":"-rtsp_transport http -re -i rtsp://10.1.10.16:7447/5a7da761c2dcfd8e4dc2c667_0?apiKey=E6mzzamX5VXJJwAkl3XaftP4MGr4lvi4","stillImageSource":"https://192.168.1.6:7443/api/2.0/snapshot/camera/5a7da761c2dcfd8e4dc2c667?force=true&apiKey=E6mzzamX5VXJJwAkl3XUftP4MGr4lvy4","maxStreams":2,"maxWidth":1920,"maxHeight":1080,"maxFPS":24} +0ms camera-ffmpeg-ufv {"name":"UVC-Enterence-2","videoConfig":{"source":"-rtsp_transport http -re -i rtsp://10.1.10.16:7447/5a7da761c2dcfd8e4dc2c667_0?apiKey=E6mzzamX5VXJJwAkl3XaftP4MGr4lvy4","stillImageSource":"https://192.168.1.6:7443/api/2.0/snapshot/camera/5a7da761c2dcfd8e4dc2c667?force=true&apiKey=E6mzzamX5VXJJwAkl3XUftP4MGr4lvi4","maxStreams":2,"maxWidth":1920,"maxHeight":1080,"maxFPS":24}} +0ms camera-ffmpeg-ufv Error parsing JSON! TypeError: Cannot read property 'length' of null +2ms

Possible ffmpeg optimizations

The way the ffmpeg command is currently setup, it’s transcoding the video due to the vcodec/vf params:

let ffmpegCommand = this.ffmpegSource + ' -threads 0 -vcodec '+vcodec+' -an -pix_fmt yuv420p -r '+
fps +' -f rawvideo -tune zerolatency -vf scale='+ width +':'+ height +' -b:v '+ bitrate +'k -bufsize '+
 bitrate +'k -payload_type 99 -ssrc '+ videoSsrc +' -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params '+
 videoKey.toString('base64')+' srtp://'+targetAddress+':'+targetVideoPort+'?rtcpport='+targetVideoPort+
 '&localrtcpport='+targetVideoPort+'&pkt_size=1378';

Since the UniFi cams already broadcast in h264/aac the only real reason to transcode is if there‘s a need for the scaling/bitrate adjustments, and I’m unsure if there is? I’ve dropped the extra params as follows and haven’t experienced any negative side effects:

let ffmpegCommand = this.ffmpegSource + ' -y -threads 0 -vcodec copy -an -f rawvideo -tune zerolatency -bufsize '+
 bitrate +'k -payload_type 99 -ssrc '+ videoSsrc +' -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params '+
 videoKey.toString('base64')+' srtp://'+targetAddress+':'+targetVideoPort+'?rtcpport='+targetVideoPort+
 '&localrtcpport='+targetVideoPort+'&pkt_size=1378';

Using the above args, I’ve been able to reduce connect time/latency to a little less than 5s (previously on my hardware it was anywhere from 20-30s), and obviously the CPU usage dropped substantially since it’s essentially just transmuxing now (or whatever the appropriate term is when converting stream types).

I have a fair amount of experience with ffmpeg (unfortunately not when it comes to streams, so a bit of research for me to do) and I’m working to get latency down to ~1s so it’s on par with the UniFi Video mobile app.

Before I go too far down this rabbit hole are there are any unintended drawbacks of doing this that I’ve overlooked? If not, I’ll open a PR and share whatever progress I make there.

Crashing homebridge

Hi,

thank you for this plugin, it used to work great on my previous homebridge
I am running homebridge on iMac now (used to run on my synology NAS) and I have an issue.

I installed the ffmpeg binaries from ffmpeg.org and installed your plugin. I can find the cameras on my phone, but now comes the issue:

When I click on the still from the camera to view the video I am getting an error and the whole homebridge crashes. I get following in terminal:

-rtsp_transport http -re -i rtsp://192.168.1.103:7447/5967ba0ee4b0b63b7a1a8af3_0?apiKey=jdMGHJ7KDcJa7H0aaaaa1aOxhK0KMBhA -threads 0 -vcodec libx264 -an -pix_fmt yuv420p -r 30 -f rawvideo -tune zerolatency -vf scale=1280:720 -b:v 299k -bufsize 299k -payload_type 99 -ssrc 1 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params 09q9WCfc7xxxxxxxxxxxBAcuU3pYM srtp://192.168.1.151:61434?rtcpport=61434&localrtcpport=61434&pkt_size=1378
events.js:137
throw er; // Unhandled 'error' event
^

Error: spawn ffmpeg ENOENT
at _errnoException (util.js:1003:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:201:19)
at onErrorNT (internal/child_process.js:389:16)
at process._tickCallback (internal/process/next_tick.js:152:19)

EDIT: problem solved by correct installation of ffmpeg
I used this command:

brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

David

ignore unmanaged cameras

i have a new cam in my net that is not managed by the nvr but by protect.

for this cam discoveredChannels is null in the loop over all discoveredCameras.

so there has to be an added

                   if( !discoveredChannels )
                    return;

in the loop.

No Sound in Home app

Hello,

I have been fighting issues with live streaming but finally have the video connecting. My issue now is that there is no sound played back when the stream is live. When viewing the stream in unifi video, there is sound, so this is not a disabled microphone issue.

There are no errors displayed in the log, one example from the log is:

-rtsp_transport http -re -i rtsp://192.168.1.161:7447/5a5101dae4b074af1014d7e3_0?apiKey=***** -threads 0 -vcodec libx264 -an -pix_fmt yuv420p -r 15 -f rawvideo -tune zerolatency -vf scale=1280:720 -b:v 299k -bufsize 299k -payload_type 99 -ssrc 3160828 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params FkZ8vzJ8Gaar0WPt9hgZnyBmLvmWjkXOayrDGBzL srtp://192.168.1.181:54249?rtcpport=54249&localrtcpport=54249&pkt_size=1378

I am running homebridge inside of docker on my synology DS918+ and have installed ffmpeg in both NPM and apt.

Any ideas how I can get sound? This has been incredibly useful to get the snapshot previews and quick loading of live video, the sound would truly be the icing on the cake.

Automation to receive camera shots on motion

It seems this should be possible but it doesn’t seem like I’m able to create an automation that does anything with the camera on motion sensor activity. Anyone able able to get this working?

rtsp port moved to livePortSettings

     "livePortSettings": {
        "rtspEnabled": false,
        "rtspPort": 7447,
        "rtmpEnabled": false,
        "rtmpPort": 1935,
        "rtmpsEnabled": false,
        "rtmpsPort": 7444
      },

Devices not responding under UFV 3.9.2 GA

Having not learned a thing from when the 3.9.0 GA changed RTSP handling via the API, today I upgraded my NVR to the 3.9.2 GA.

It looks like the way the API hands out RTSP stream info has changed again.

Can't Re-add Cameras to Home app

Hi,

I was a happy user of this plug-in until I spent the past weekend on a wild goose chase trying to restore the LIVE feeds in the Home app.

I didn't realize that in a recent update to the Unifi NVR, Ubiquiti added a new setting for the NVR to turn on RTSP at a centralized preference, with it off by default, causing the LIVE feeds for my cameras to stop working.

During my many various steps trying to troubleshoot the issue, I removed one of the cameras from the Home app, and can't get it added back.

To make things worse, I removed my Homebridge from the Home app, and have since removed all the cameras to re-add them and now none of the cameras seem to be available for adding.

I was able to add all of my other Homebridge accessories back to the Home app when I repaired the Homebridge with the Home app earlier today.

When I check the console for the Homebridge, I can see the cameras are active but it doesn't appear to work, as you can see from the excerpt below.

[2018-3-19 03:27:23] [UniFi Video (ffmpeg)] Published 9 camera accessories.
[2018-3-19 03:27:23] Frontyard Right is running on port 44277.
[2018-3-19 03:27:23] Patio is running on port 44225.
[2018-3-19 03:27:23] Frontyard Left is running on port 35845.
[2018-3-19 03:27:23] Porch is running on port 35171.
[2018-3-19 03:27:23] Garage Path is running on port 46343.
[2018-3-19 03:27:23] Backyard Unfinished Path is running on port 46677.
[2018-3-19 03:27:24] Backyard Stone Path is running on port 43865.
[2018-3-19 03:27:24] Backyard Left is running on port 37707.
[2018-3-19 03:27:24] Backyard Right is running on port 38145.

Any suggestions what I'm doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.