Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ffmpeg not found #211

Closed
rixxka2000 opened this issue Dec 29, 2019 · 45 comments
Closed

Ffmpeg not found #211

rixxka2000 opened this issue Dec 29, 2019 · 45 comments

Comments

@rixxka2000
Copy link

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
Copy link

burnusgas commented Dec 30, 2019

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
Copy link
Contributor

Use the wiki for installing FFMPEG

@donavanbecker
Copy link
Contributor

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

@burnusgas
Copy link

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

@askovi
Copy link

askovi commented Dec 30, 2019

sudo apt-get install ffmpeg

@burnusgas
Copy link

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
Copy link
Contributor

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

@burnusgas
Copy link

burnusgas commented Dec 31, 2019

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
Copy link

stefan52a commented Jan 1, 2020

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
Copy link
Contributor

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

@donavanbecker
Copy link
Contributor

Nvm, worked once and then stopped.

@stefan52a
Copy link

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
Copy link

@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
Copy link
Owner

dgreif commented Jan 2, 2020

@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
Copy link

arejay73 commented Jan 3, 2020

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
Copy link
Owner

dgreif commented Jan 3, 2020

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

@arejay73
Copy link

arejay73 commented Jan 3, 2020

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
+ [email protected]
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
Copy link
Contributor

donavanbecker commented Jan 3, 2020

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
Copy link

arejay73 commented Jan 3, 2020

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

@EarthRise626
Copy link

EarthRise626 commented Jan 3, 2020 via email

@arejay73
Copy link

arejay73 commented Jan 3, 2020

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
Copy link

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
Copy link
Contributor

@EarthRise626 @arejay73 @burnusgas

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

@arejay73
Copy link

arejay73 commented Jan 4, 2020

I do.

@donavanbecker
Copy link
Contributor

Turn it all completely off and see if live stream works

@arejay73
Copy link

arejay73 commented Jan 4, 2020

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
Copy link
Contributor

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
Copy link

arejay73 commented Jan 4, 2020

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
Copy link
Owner

dgreif commented Jan 5, 2020

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

  • You need to keep a fair sized range here. ~50 is probably sufficient. Each video stream will only use 2 ports, and they free up when the stream is done, so theoretically you only need ~2-10 depending on how many simultaneous streams you are doing. However the code is not bullet proof and I have seen cases where a stream gets into a funky state and doesn't free up the ports that it is using (which is one of the big reasons I prefer using random ports). I will probably circle back and work on some of these corner cases, but for now just know that they exist and you may have to restart homebridge if you see a message about prefered ports being depleted.
  • This range is used for the external ports only. These are the two ports that we give to Ring to tell them where to send the audio and video streams. Other local ports (ffmpeg, pass through for HomeKit) will still use random ports.
  • There is no documentation for this yet. I do not want to encourage locking down the external ports. If a user can get by with random ports, that is a much much better way to go. This is only for users who have no other option (seems to be mainly Eero users at this point).
  • I found a couple small corner cases while working on this that may have been causing some issue, tho not likely the issues that seem to plague only Eero users. I would really appreciate some testing both with and without externalPorts set by some of you Eero owners. Please let me know how it goes!

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

@htims1989
Copy link

htims1989 commented Jan 7, 2020

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
Copy link
Owner

dgreif commented Jan 10, 2020

@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
Copy link
Author

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
Copy link
Owner

dgreif commented Jan 10, 2020

@rixxka2000 assuming your homebridge setup is like most, you can run npm i -g [email protected] (might need sudo on the front if it complains about permissions)

@rixxka2000
Copy link
Author

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

@rixxka2000
Copy link
Author

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
Copy link
Owner

dgreif commented Jan 10, 2020

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

@rixxka2000
Copy link
Author

no my network is all apple airport extremes and expresses

@dgreif
Copy link
Owner

dgreif commented Jan 10, 2020

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
Copy link
Author

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
Copy link
Owner

dgreif commented Jan 10, 2020

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
Copy link
Author

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
Copy link

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

@giejay
Copy link

giejay commented Jan 14, 2020

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
Copy link
Owner

dgreif commented Jan 15, 2020

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests