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

Updated to 12.0 #1305

Closed
1 task done
arolnick1 opened this issue Aug 30, 2023 · 21 comments
Closed
1 task done

Updated to 12.0 #1305

arolnick1 opened this issue Aug 30, 2023 · 21 comments
Labels
bug Something isn't working

Comments

@arolnick1
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe The Bug

I get an FFMPEG not installed error when streaming. I do have ffmpeg for homebridge installed as well as ffmpeg installed on the PC.

To Reproduce

No response

Expected behavior

i used to hear audio on the live stream, prior to update

Relevant log output

[8/30/2023, 11:48:37 AM] [Ring] Stream Prepared for Front Door (0.13s)
[8/30/2023, 11:48:37 AM] [Ring] Streaming video only - ffmpeg was not found. See https://github.com/dgreif/ring/wiki/FFmpeg for details.

Screenshots

No response

Homebridge Ring Config

{
    "refreshToken": XXX,
    "unbridgeCameras": true,
    "hideDoorbellSwitch": true,
    "debug": true,
    "cameraStatusPollingSeconds": 4,
    "platform": "Ring"
}

Additional context

No response

OS

windows 10

Node.js Version

18.6.0

NPM Version

?

Homebridge/HOOBs Version

4.50.4

Homebridge Ring Plugin Version

12.0.0

Operating System

windows 10

@arolnick1 arolnick1 added the bug Something isn't working label Aug 30, 2023
@tsightler
Copy link
Collaborator

Is ffmpeg in the system PATH environment under which Homebridge is run? You can try setting "ffmpegPath" config option explicitly.

@arolnick1
Copy link
Author

arolnick1 commented Aug 30, 2023 via email

@arolnick1
Copy link
Author

arolnick1 commented Aug 30, 2023 via email

@tsightler
Copy link
Collaborator

I suggest trying to add the ffmpegPath option to the Ring Homebridge config.

@arolnick1
Copy link
Author

arolnick1 commented Aug 30, 2023 via email

@tsightler
Copy link
Collaborator

It really shouldn't be required, but I'm guessing some weird side effect running on Windows. It should be as simple as adding something like this just before the "platform": "Ring" (just tested and it let me add it):

"ffmpegPath": "C:\ffmpeg\bin\ffmpeg.exe",

I've not personally tested this plugin code on native Windows (the author potentially has but I have not) so I'm guessing a little bit, but as Windows as some unique path handling in node, I wonder if there's something wrong here.

@arolnick1
Copy link
Author

arolnick1 commented Aug 30, 2023 via email

@tsightler
Copy link
Collaborator

tsightler commented Aug 30, 2023

And this only started with version 12.0.0 after Dusty made improvements to the audio.

What is confusing about that is that there were no changes in the way ffmpeg is referenced and the audio improvements were just the addition of a handful of additional flags to the existing ffmpeg options which produce a more consistent audio stream. There were no other changes (I know, I submitted the PR for the audio improvements).

It almost seems like your ffmpeg-for-homebridge package failed to install the binary, as that is the one that should be used. I don't understand why it is not being found.

Did you change anything else? Perhaps upgrade Node at the same time? I see you are on a pretty old version, perhaps try updating to the latest LTS version which is v18.17.1.

@arolnick1
Copy link
Author

arolnick1 commented Aug 30, 2023 via email

@tsightler
Copy link
Collaborator

Try this adding this to the config and restarting:

"ffmpegPath": "ffmpeg",

That should force it to search the system path. Just a shot.

@arolnick1
Copy link
Author

arolnick1 commented Aug 30, 2023 via email

@tsightler
Copy link
Collaborator

So I just went through the process of installing Homebridge on a Windows system, installed the Ring plugin, connected to Ring account, added to Home app, view a camera, worked perfectly. Found ffmpeg from the ffmpeg-for-homebridge package, no problem. Unfortunately, I don't know any other things to suggest. I'm using Node v18.17.1, but that's about the only difference I can think of. Followed the instructions at https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Windows-10 which I assume are the same steps you used.

@arolnick1
Copy link
Author

arolnick1 commented Aug 30, 2023 via email

@tsightler
Copy link
Collaborator

tsightler commented Aug 30, 2023

Definitely 64-bit node, filename is node-v18.17.1-x64.msi. I don't do anything with 32-bit code anymore, and haven't for years on x86 platforms.

The code that is generating the message is super basic and largely unchanged going back years, so it's hard for me to even theorize what could be going wrong. Basically there's a single call to a function which is part of the @homebridge/camera-utils package, specifically, doesFfmpegSupportCodec('libfdk_aac', getFfmpegPath()). The primary goal of this call is to determine if the ffmpeg binary has libfdk_aac included, but a secondary result is if ffmpeg is not found at all.

Unless the ffmpegPath option has been manually set, as we tried above, the getFfmpegPath() call will return undefined and so camera-utils will use the path returned from importing ffmpegForHomebridgePath from the ffmpeg-for-homebridge package.

Is there definitely an ffmpeg.exe in you path in the ffmpeg-for-homebridge package? Should be in a path similar to:

C:\Users\<your_username>\AppData\Roaming\npm\node_modules\homebridge-ring\node_modules\ffmpeg-for-homebridge

And, if there is one in this path, what happens when you run ffmpeg.exe -version or ffmpeg.exe -codecs?

@arolnick1
Copy link
Author

arolnick1 commented Aug 30, 2023 via email

@tsightler
Copy link
Collaborator

So that version of ffmpeg probably doesn't help much since it doesn't have libfdk_aac, the output from that version of ffmpeg:
DEAIL. aac AAC (Advanced Audio Coding) (decoders: aac aac_fixed) (encoders: aac aac_mf)

Output of codecs from ffmpeg-for-homebridge:
DEAIL. aac AAC (Advanced Audio Coding) (decoders: aac aac_fixed libfdk_aac ) (encoders: aac libfdk_aac aac_mf )

I'd probably uninstall that ffmpeg version and focus on getting the ffmpeg-for-homebridge working as that is the recommended setup and should definitely work. Is there definitely an ffmpeg.exe in the homebridge-ring/node_modules/ffmeg-for-homebridge directory?

@arolnick1
Copy link
Author

definitely

@arolnick1
Copy link
Author

C:\Users\Admin\AppData\Roaming\npm\node_modules\homebridge-ring\node_modules\ffmpeg-for-homebridge.build\ffmpeg.exe

@arolnick1 arolnick1 reopened this Aug 30, 2023
@arolnick1
Copy link
Author

Its located in:
C:\Users\Admin\AppData\Roaming\npm\node_modules\homebridge-ring\node_modules\ffmpeg-for-homebridge.build\ffmpeg.exe

so I removed the ffmpeg path from the JSON config. Updated the node.js to the same 18.17.1.
still get the error.

I notice my ffmpeg.exe is in a folder called .build. Is that correct?

@arolnick1
Copy link
Author

And that fixed it. i moved the ffmpeg.exe into the ffmpeg-for-homebridge foler, out of the .build folder and that fixed it. Your help was invaluable!!!!

@tsightler
Copy link
Collaborator

Interesting, so for some reason the install of ffmpeg-for-homebridge failed. The ffmpeg-for-homebridge package is basically just a small javascript file which downloads the correct pre-compiled binary for your platform. Immediately after installing the package this script is run and it creates the ffmpeg-for-homebridge.build folder to download the release binary into, then it should copy it to the ffmpeg-for-homebridge directory and delete the temporary directory. Obviously those last two steps didn't happen in your case. Very strange, but glad you got it working.

I'll go ahead a close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants