dgreif / ring

Unofficial packages for Ring Doorbells, Cameras, Alarm System, and Smart Lighting
MIT License
1.23k stars 163 forks source link

Ffmpeg not found #211

Closed rixxka2000 closed 4 years ago

rixxka2000 commented 4 years ago

Is anyone else having an issue with streaming video, i can get motion alerts , doorbell alerts and screenshots but no live feed, i installed ffmpeg and verified that it is working by typing ffmpeg into command prompt with admin access. When i check my homebridge log it shows “ffmpeg cannot be found”

Probably a stupid mistake on my part ,

I am using a ring pro , and don’t have 2fa

Thanks

burnusgas commented 4 years ago

Identical problem - using HOOBS.

Having an issue with Ring cameras - will show the snapshot, but not the live video. Log shows that it cannot find ffmpeg. Used terminal to install using "sudo npm install ffmpeg" and it appeared to install - restarted service, restarted appletv hub, restarted iPhone, added ring camera to Home app again. Didn't work - log still showing that it cannot find ffmpeg. The error in the Home app is "No Response. This camera is not responding." All the doorbell cams, spotlight cams, & inside cams work fine on Ring app. Using Eero Pro mesh system w/ ethernet backhaul. Raspberry Pi 3.

donavanbecker commented 4 years ago

Use the wiki for installing FFMPEG

donavanbecker commented 4 years ago

Eero must of changed something. Because ever since 3.17 I think. I haven’t had live stream

burnusgas commented 4 years ago

Live stream still works in ring app for you though? Does for me, just not in Home app.

askovi commented 4 years ago

sudo apt-get install ffmpeg

burnusgas commented 4 years ago

Thank you.

Log shows ffmpeg found now, but still no live stream

[Homebridge] [12/30/2019, 17:51:09] [Ring] Snapshot for Pond Received (3.754s) [Homebridge] [12/30/2019, 17:51:17] [Ring] Preparing Live Stream for Pond [Homebridge] [12/30/2019, 17:51:17] [Ring] Streaming video only - found ffmpeg, but libfdk_aac is not installed. [Homebridge] [12/30/2019, 17:51:20] [Ring] Waiting for stream data from Pond (2.983s) [Homebridge] [12/30/2019, 17:51:27] [Ring] Stopped Live Stream for Pond

donavanbecker commented 4 years ago

You need follow the wiki for FFMPEG, so it is your eero.

burnusgas commented 4 years ago

Opened most of the ports for a ring camera based on this - https://support.ring.com/hc/en-us/articles/205385394-What-Ports-Do-I-Need-to-Open-in-My-Firewall-for-Ring-Doorbells-and-Chimes-

Ports | Traffic type | Protocol

15063/15064 | SIP | TCP/UDP 9998/9999/6970 | RSS | TCP 16500-65000 | RTP | UDP (could not do this whole range since Eero app allows only 100 range) 7076/7077 | App | UDP 9078/9079 | App | UDP

Restarted iPhone, appletv, Pi, deleted & added that ring camera - no live view.

stefan52a commented 4 years ago

16500-65000 | RTP | UDP (could not do this whole range since Eero app allows only 100 range)

Opening up these port towards the machine on which the software of this repository is running, works for me. Not that I want to open all these ports....

donavanbecker commented 4 years ago

Same here when I opened up the ports that the cameras are on that HomeBridge assigns it works

donavanbecker commented 4 years ago

Nvm, worked once and then stopped.

stefan52a commented 4 years ago

Did some digging and ugly hacking, eventually in node_modules/ring-client-api/lib/api/rtp-utils.js defined a var i; and changed the function bindToRandomPort(socket)

to function bindToRandomPort(socket) { return new Promise(resolve => { // 0 means select a random open port socket.bind(18000+i++, () => { const { port } = socket.address(); resolve(port); }); }); }

This enabled the number of open UDP ports to be forwarded to be a smaller range e.g. 18000-18100

I might be breaking other things here in the source, so please do not change your source this way, and accept this to be only informational.

HybridSarcasm commented 4 years ago

@rixxka2000 Wanted to add something else to this discussion. ffmpeg needs to be present for audio in the live feed. For video-only live feed, the plugin can provide that 'out of the box'. If you can't even get live video feed, ffmpeg isn't your problem. It's likely a network issue. Besides reading the troubleshooting wiki for networking configurations, check out Issue #191. We should have an update soon that resolves my problem from #191.

dgreif commented 4 years ago

@SeminolesFan78 is spot on with his response. FFMPEG is not required to do live streaming, only if you want audio. If you want audio in homebridge, sudo apt-get install ffmpeg is not sufficient because it does not include libfdk_aac (@askovi). To get proper audio support, follow the steps in https://github.com/dgreif/ring/wiki/FFmpeg as recommended by @d0n4v4nb3ck3r.

With ffmpeg aside, live streaming failures come down to network related issues. The most common issue so far has been that the users router does not properly open the port for UDP traffic to flow in for the live stream. #191 has a lot of detail about why this happens, but the simplest explanation is that the requests to open a port were not always being sent to your default gateway, just a preset list of common default gateway ip address. This has been fixed in v5.12.1, so if you have an odd ip for your default gateway, you should now be more likely to get a working live stream.

There is still a possibility that live streams won't work, even on v5.12.1. If you update and are still not able to get a stream, check the settings in your router to see if you can turn on UPnP or NAT-PMP. If either is enabled and live streams still don't work, then port forwarding would be the last resort. As @stefan52a pointed out, the range of ports used by this plugin is unreasonable to forward at this time. That's because it currently binds to a random port every time, and the range for the random ports is huge. I've been tossing around the idea of limiting the range (and making it configurable) like @stefan52a did in his example above, but have been avoiding in because there are lots of corner cases where those ports could get bound and become unusable, preventing live streams from working for yet another reason. I went the random port route because you can always get a port. Given the number of live stream issues that have been opened recently, I am definitely reconsidering this approach, and may have an update in the next week or two that allows for custom port ranges. First, let's see how v5.12.1 works for everyone.

arejay73 commented 4 years ago

16500-65000 | RTP | UDP (could not do this whole range since Eero app allows only 100 range)

Opening up these port towards the machine on which the software of this repository is running, works for me. Not that I want to open all these ports....

So did you open 100 ports like 16500 to 16599? I only did 10 to see if I could get it to work, but I get this.

The screen goes black and then it disconnects. When I don't have to ports open it spins on the snapshot picture and then says it is disconnected. So, I am thinking that it is kinda working but I just need to open more ports?

[1/3/2020, 11:10:26 AM] [Ring] Preparing Live Stream for Front Door
[1/3/2020, 11:10:28 AM] [Ring] Waiting for stream data from Front Door (2.623s)
[1/3/2020, 11:10:28 AM] [Ring] Received stream data from Front Door (2.633s)
[1/3/2020, 11:10:28 AM] [Ring] Streaming active for Front Door
[1/3/2020, 11:10:29 AM] [Ring] Stopped Live Stream for Front Door
dgreif commented 4 years ago

@arejay73 please try v5.12.1 and see if it works without forwarding any specific ports

arejay73 commented 4 years ago

So, how do I verify that I have installed v5.12.1? I ran the following commands:

npm i -g homebridge-ring
/usr/local/bin/ring-auth-cli -> /usr/local/lib/node_modules/homebridge-ring/ring-auth-cli.js
+ homebridge-ring@5.12.1
updated 1 package in 3.896s

I removed the doorbell, restarted Homebridge and then add the doorbell back.

I am able to see the snapshot updating, but no live feed. I get the message it trying to start.

My network router is an Eero.

Should I try opening the UDP Ports and try again?

donavanbecker commented 4 years ago

I think this is an Eero issue! I turned of UPnP under Advanced in Eero App and Live Video works once. I try again and it doesn't work. Then I turn UPnP on and it works again. I try again after a little bit and it stops working.

arejay73 commented 4 years ago

Ok. I will talk to eero support and see if we can find a resolution.

EarthRise626 commented 4 years ago

Having the same issue here - I also use eero.

Thank you!

Bradley Ward


From: arejay73 notifications@github.com Sent: Friday, January 3, 2020 5:10 PM To: dgreif/ring Cc: Subscribed Subject: Re: [dgreif/ring] Ffmpeg not found (#211)

Ok. I will talk to eero support and see if we can find a resolution.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/dgreif/ring/issues/211?email_source=notifications&email_token=AMTPLOTQYJSUVDSQG7S5GRTQ36ZWFA5CNFSM4KA2BG4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEICGL4A#issuecomment-570713584, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMTPLOT3J5QIQIA7PPXP2ULQ36ZWFANCNFSM4KA2BG4A.

arejay73 commented 4 years ago

Had no luck with eero support. They swapped my eero’s around. Did some tinkering with UPNP on their end. Determined that if my Plex server was using UPNP ok it must be a Ring issue.

burnusgas commented 4 years ago

16500-65000 | RTP | UDP (could not do this whole range since Eero app allows only 100 range)

Opening up these port towards the machine on which the software of this repository is running, works for me. Not that I want to open all these ports....

So did you open 100 ports like 16500 to 16599? I only did 10 to see if I could get it to work, but I get this.

The screen goes black and then it disconnects. When I don't have to ports open it spins on the snapshot picture and then says it is disconnected. So, I am thinking that it is kinda working but I just need to open more ports?

[1/3/2020, 11:10:26 AM] [Ring] Preparing Live Stream for Front Door
[1/3/2020, 11:10:28 AM] [Ring] Waiting for stream data from Front Door (2.623s)
[1/3/2020, 11:10:28 AM] [Ring] Received stream data from Front Door (2.633s)
[1/3/2020, 11:10:28 AM] [Ring] Streaming active for Front Door
[1/3/2020, 11:10:29 AM] [Ring] Stopped Live Stream for Front Door

I opened 16500 - 16599 along with all the other ports specified. Doesn’t work - same as before I opened the ports.

donavanbecker commented 4 years ago

@EarthRise626 @arejay73 @burnusgas

If you all have eero? Do you have eero secure on at all?

arejay73 commented 4 years ago

I do.

donavanbecker commented 4 years ago

Turn it all completely off and see if live stream works

arejay73 commented 4 years ago

Nope. Got similar behavior to toggling the UPNP setting.

Turned Off advanced security and tested - Got a blank screen

[1/4/2020, 7:54:38 AM] [Ring] Preparing Live Stream for Front Door
[1/4/2020, 7:54:41 AM] [Ring] Waiting for stream data from Front Door (2.558s)
[1/4/2020, 7:54:41 AM] [Ring] Received stream data from Front Door (2.562s)
[1/4/2020, 7:54:41 AM] [Ring] Streaming active for Front Door
[1/4/2020, 7:54:42 AM] [Ring] Stopped Live Stream for Front Door

Tried again - Hung at snapshot says No response - This camera is not responding

[1/4/2020, 7:55:53 AM] [Ring] Preparing Live Stream for Front Door
[1/4/2020, 7:55:53 AM] [Ring] Waiting for stream data from Front Door (0.417s)
[1/4/2020, 7:56:03 AM] [Ring] Stopped Live Stream for Front Door

Toggled UPNP - Hung at snapshot says No response - This camera is not responding

[1/4/2020, 7:56:43 AM] [Ring] Preparing Live Stream for Front Door
[1/4/2020, 7:56:45 AM] [Ring] Waiting for stream data from Front Door (2.528s)
[1/4/2020, 7:56:53 AM] [Ring] Stopped Live Stream for Front Door
donavanbecker commented 4 years ago

Turn ever single eero secure setting off? Advanced Security, Ad blocking, and safe filters? Because It has all worked since I turned that off

arejay73 commented 4 years ago

Bummer, didn’t work. Tried with Everything turned off. Still got same behavior as not turning off safe filters.

My iot devices are not on an eero profile So I left the safe filters alone and with my family disabling For other devices won’t be an option at this time.

dgreif commented 4 years ago

Ok, I finally broke down and implemented external port configuration. To give it a try, install v5.13.0-alpha.0. You will need to add the following to your config (api and homebridge both support this, use whatever start/end seem good to you):

"externalPorts": {
  "start": 10000,
  "end": 10050
}

LOTS OF NOTES/ASTRICTS on this

Thank you all for your patience. Hopefully this is the finally step to get streaming working for everyone! 🤞

htims1989 commented 4 years ago

Just upgraded to 5.13.0-alpha.0, still struggling with live video with a Ring Doorbell 2. I think this might be a separate issue but I keep getting:

[Ring] Error: sip INVITE request failed with status 480

However, if I use two devices and use the Ring app on the first device to view the live stream and then open the Home app on the second, it works fine every time. I can repeat this over and over.

dgreif commented 4 years ago

@htims1989 the 480 errors happen when you start/stop/start the stream for a camera repeatedly in a short period of time. I have spent hours try to fix it, but no luck so far. I can't quite pin down what Ring is doing differently with their SIP requests compared to ours.

@arejay73 @rixxka2000 @burnusgas @EarthRise626 can some of you try out 5.13.0-alpha.0? @donavanbecker gave it a try, but it sounds like forwarding ports didn't really fix anything for him (he still needed the Advanced Security features turned off to make it work reliably). Would love to get some more testing in to know if the port locking is worth it!

rixxka2000 commented 4 years ago

Hi @dgreif I am more than happy to try the Alpha release , can you let me know how to upgrade to it as the homebridge config x won't show alpha releases, sorry noob question :-)

dgreif commented 4 years ago

@rixxka2000 assuming your homebridge setup is like most, you can run npm i -g homebridge-ring@5.13.0-alpha.0 (might need sudo on the front if it complains about permissions)

rixxka2000 commented 4 years ago

I had guessed that but just wanted to check , ill do it now ,

rixxka2000 commented 4 years ago

still nothing sorry

[1/10/2020, 15:09:50] [Ring] Preparing Live Stream for Front Door [1/10/2020, 15:09:51] [Ring] Streaming video only - found ffmpeg, but libfdk_aac is not installed. [1/10/2020, 15:09:52] [Ring] Waiting for stream data from Front Door (1.288s) [1/10/2020, 15:10:01] [Ring] Stopped Live Stream for Front Door

dgreif commented 4 years ago

@rixxka2000 did you try locking the ports using externalPorts config and forwarding those ports on your rotuer? Are you using the Eero?

rixxka2000 commented 4 years ago

no my network is all apple airport extremes and expresses

dgreif commented 4 years ago

Can you try turning on NAT-PMP in your main router? If it is off, that would explain why the plugin is unable to open a port

rixxka2000 commented 4 years ago

nat-pmp is enabled on the main router , I don't have a default host ip specified but it should be auto configured in that case

dgreif commented 4 years ago

Man, that's really odd that it still won't work. Is it possible that the stream is passing through multiple airport devices to get to your homebridge server? If so, you would need to make sure that all except your main router are as transparent as possible (no DHCP enabled, etc). I will take another look at the NAT punching setup when I get a chance. There must be a better way to do it that isn't so reliant on networks being properly configured 🤞

rixxka2000 commented 4 years ago

I agree , and no it’s a direct route , the main router is right beside the ring pro (about 2meters away) and it is hardwired up to an unmanaged 16 port switch and into the pc where Homebridge is running ,

nestor201081 commented 4 years ago

Same issue here. [2020-1-12 13:30:33] [Ring] Streaming video only - found ffmpeg, but libfdk_aac is not installed.

giejay commented 4 years ago

I wanted to debug my random "only sound" issue so I tried to run it without docker.

Installed ffmpeg, installed node 10 and ran the record example. Unfortunately, now I'm back to the 286 bytes video problem. I also tried node 10, but that doesn't work either. Anybody an idea?

dgreif commented 4 years ago

I just released v5.13.1 which fixes a number of issues while starting a live stream. From what I can tell, the only remaining issues are isolated to users with an Eero, or some complex network that causes the current nat-punch solution to fail to open ports correctly. If anyone makes progress on Eero or nat punching, please let me know either in the homebridge slack, or by creating a new issue. I'm going to close this issue because we have gotten a long way away from Ffmpeg not found 😅

JazzerAlto commented 4 years ago

I took another run at Eero to fix this without any success. I can confirm for my situation that I ended up leaving my previous Airport Extreme as my main router with WiFi turned off and then have 3 Eero Pros hardwired into a common switch with the Eero in bridge mode and the Airport Extreme with NatPMP enabled and my live stream consistently work. When I put the Eero in the router spot, even with uPNP enabled, I had hit or miss success opening a stream which proves the Eero is handling things differently. Here's the question I have. The Ring App never misses a beat and stream always open. Is that because the stream is coming from a Ring server in the cloud and not directly from the camera? Part of me keeps thinking if it works in the Ring app, then it's still an issue with the Ring HB code and not the Eero.