potmat / homebridge-google-nest-sdm

A Homebridge plugin for Google Nest devices that uses the Google Smart Device Management API. Supports Cameras, Doorbells, Displays, and Thermostats. Includes support for HomeKit Secure Video.
ISC License
134 stars 15 forks source link

No HSKV -Failed to start stream: input to ffmpeg was provides as stdin, but the process does not support stdin. #101

Closed vgnnair closed 5 months ago

vgnnair commented 10 months ago

I see 2 similar issue where apple device not able to download the stream - https://github.com/potmat/homebridge-google-nest-sdm/issues/62 and https://github.com/potmat/homebridge-google-nest-sdm/issues/59. The issue were closed with a proposed solution or resolved by running Homebridge on a host directly (such as an RPi) on the local network

I have the set up of homebridge in rpi on local network and still encountering below issue

Error on homebridge logs Failed to start stream: input to ffmpeg was provides as stdin, but the process does not support stdin. Recording download stream 1 is still awaiting generator although stream was closed 10s ago! This is a programming mistake by the camera implementation which prevents freeing up resources.

Hoping a future release can resolve this issue

timlmeyer commented 9 months ago

I'm having the same issue with Homebridge installed directly on my Mac Mini.

potmat commented 9 months ago

I'm terribly sorry about this guys, I have no idea why a process on the rPi would not accept standard input... Without being there it's very hard for me to figure out what's going on with your specific configuration.

potmat commented 9 months ago

If anyone having this issue is able to debug is locally and/or provide a possible fix it would be appreciated.

DannyZolp commented 9 months ago

I had a similar problem with all of this, and what it came down to was the version of ffmpeg I was using. Homebridge offers their own ffmpeg fork with their own patches that work with homebridge apps, located here: https://github.com/homebridge/ffmpeg-for-homebridge

Did you guys just install ffmpeg using brew or did you install the homebridge fork?

OscAr1um commented 6 months ago

Having the same issue. In particular, I'm running homebridge on AMD platform. The new ffmpeg-for-homebridge has support of amf.

GreatWiz commented 6 months ago

I also have this issue. I have the nest battery version doorbell. I suspect that like it's mentioned in another issue, a different function needs to be used to get its video recordings, and this is the reason ffmpeg fails. I'll be happy to help with debugging and fixing this (I am a software engineer), but I have no idea how to setup a work environment with this plugin code, and how to deploy it in order to test it (I'm running home bridge on a raspberry pi).

potmat commented 5 months ago

@GreatWiz: I edit the plugin code on my laptop, then after an npm run build I deploy it to my rPi using scp.

Note that on your rPi you'll need to use npm link to force npm to look in your deploy directory for the package rather than where it would usually look.

GreatWiz commented 5 months ago

I'll try in the coming days, thanks for the tips

iknowdjz commented 5 months ago

I have the same issue on all of my Nest cameras. I do not have the doorbell, these are all standard Google Nest cams with the same issue. LMK if can provide any details to assist.

potmat commented 5 months ago

@iknowdjz : Any insight you can offer would help. I can't reproduce this issue myself, and I have no idea what the reason some people experience it is. ffmpeg supports stdin (or should) so there's something in your environments block it. What that is I have no idea.

iknowdjz commented 5 months ago

Hey @potmat, not sure if this is related, but I turned on debug mode and noticed in the logs that the path for ffmpeg-for-homebridge is pointing to /Users/hjd/ is that intentional? hjd is not my user path.

[1/23/2024, 3:50:08 PM] [homebridge-google-nest-sdm] [info] configuration: --enable-videotoolbox --enable-hardcoded-tables --enable-nonfree --enable-gpl --enable-hardcoded-tables --enable-openssl --enable-libdav1d --enable-libsvtav1 --enable-libx264 --enable-libx265 --enable-libxvid --enable-libvidstab --enable-libzimg --enable-lv2 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libtheora --enable-libfdk-aac --enable-libsrt --disable-debug --disable-shared --enable-pthreads --enable-static --enable-version3 --extra-cflags='-I/Users/hjd/ffmpeg-for-homebridge/darwin-arm64/workspace/include -I/Users/hjd/ffmpeg-for-homebridge/darwin-arm64/workspace/include/lilv-0' --extra-ldexeflags= --extra-ldflags=-L/Users/hjd/ffmpeg-for-homebridge/darwin-arm64/workspace/lib --extra-libs='-ldl -lpthread -lm -lz' --pkgconfigdir=/Users/hjd/ffmpeg-for-homebridge/darwin-arm64/workspace/lib/pkgconfig --pkg-config-flags=--static --prefix=/Users/hjd/ffmpeg-for-homebridge/darwin-arm64/workspace --extra-version=homebridge-darwin-arm64 Hallway Camera

potmat commented 5 months ago

@iknowdjz: That is odd. I don't know why that would be the case... I'm not sure if that's having an effect or not.

potmat commented 5 months ago

Try version 1.1.21 and see if it solves the issue. Thanks to @PatrickStankard for (hopefully) providing the solution.

iknowdjz commented 5 months ago

Hi @potmat, after upgrading I know longer see that error. Thanks @PatrickStankard for the assist here.

Now to only figure out why none of the live views work, but watching the recordings is no issue :-/ Ill dig into that later.

potmat commented 5 months ago

@iknowdjz: Are you still getting the stdin error on the live streams?

iknowdjz commented 5 months ago

@potmat no errors on livestream. It tries to load for about 30 seconds before saying This Camera is not responding. Happens with all 8 cameras. Here is what is in the logs after a restart. I can enable debug mode and share more if helpful:


[1/31/2024, 9:08:00 AM] Registering platform 'homebridge-google-nest-sdm.homebridge-google-nest-sdm'
[1/31/2024, 9:08:00 AM] [homebridge-google-nest-sdm] Loaded homebridge-google-nest-sdm v1.1.21 child bridge successfully
[1/31/2024, 9:08:00 AM] Loaded 8 cached accessories from cachedAccessories.0E5D5BD04855.
[1/31/2024, 9:08:00 AM] [homebridge-google-nest-sdm] Loading accessory from cache: Alley Camera
[1/31/2024, 9:08:00 AM] [homebridge-google-nest-sdm] Loading accessory from cache: Garage Camera
[1/31/2024, 9:08:00 AM] [homebridge-google-nest-sdm] Loading accessory from cache: Alley Camera
[1/31/2024, 9:08:00 AM] [homebridge-google-nest-sdm] Loading accessory from cache: Hallway Camera
[1/31/2024, 9:08:00 AM] [homebridge-google-nest-sdm] Loading accessory from cache: Entryway Camera
[1/31/2024, 9:08:00 AM] [homebridge-google-nest-sdm] Loading accessory from cache: Alley Camera
[1/31/2024, 9:08:00 AM] [homebridge-google-nest-sdm] Loading accessory from cache: Hallway Camera
[1/31/2024, 9:08:00 AM] [homebridge-google-nest-sdm] Loading accessory from cache: Garage Camera
[1/31/2024, 9:08:00 AM] Homebridge v1.7.0 (HAP v0.11.1) (homebridge-google-nest-sdm) is running on port 37245.
[1/31/2024, 9:08:01 AM] [homebridge-google-nest-sdm] Restoring existing accessory from cache: Alley Camera
[1/31/2024, 9:08:01 AM] [homebridge-google-nest-sdm] Restoring existing accessory from cache: Garage Camera
[1/31/2024, 9:08:01 AM] [homebridge-google-nest-sdm] Restoring existing accessory from cache: Alley Camera
[1/31/2024, 9:08:01 AM] [homebridge-google-nest-sdm] Restoring existing accessory from cache: Hallway Camera
[1/31/2024, 9:08:01 AM] [homebridge-google-nest-sdm] Restoring existing accessory from cache: Entryway Camera
[1/31/2024, 9:08:01 AM] [homebridge-google-nest-sdm] Restoring existing accessory from cache: Alley Camera
[1/31/2024, 9:08:01 AM] [homebridge-google-nest-sdm] Restoring existing accessory from cache: Hallway Camera
[1/31/2024, 9:08:01 AM] [homebridge-google-nest-sdm] Restoring existing accessory from cache: Garage Camera```
potmat commented 5 months ago

@iknowdjz : Debug mode would definitely help, from when you try to view the live stream.

iknowdjz commented 5 months ago

@potmat see attached, note I replaced a bunch of the sensitive data with XXXXXX. LMK if anything else will be helpful to debug. camera_log.txt

potmat commented 5 months ago

@iknowdjz : There are no errors in your logs, the plugin seems to be working fine. Looks like the packets are simply not arriving at your iPhone/Mac/etc. This can happen with issues on your LAN, for example if your iPhone is joined to a VPN, or sometimes if Homebridge is running on a container engine somewhere... the data gets sent out but never arrives.

Unfortunately without being in your house there's no way for me to determine what the issue is.

iknowdjz commented 5 months ago

@potmat come on down, ill give you a bottle of Johnnie Blue for the trouble ;) Appreciate the efforts on this plugin, great work!

potmat commented 5 months ago

Closing as the underlying issue about stdin seems to be resolved.