samemory / homebridge-eufy-security

Work in progress
Apache License 2.0
97 stars 14 forks source link

[Bug]: T8420 Stream not working #313

Closed FIRE-SORCERER closed 2 years ago

FIRE-SORCERER commented 2 years ago

What happened?

Hey everyone, I'm quite new to this plugin and am having issues with setting up my T8420 Floodlight.

Everytime I try to open the stream on home app, the stream fails to load and homebridge has the following error log (I have removed string for privacy).

Upon starting stream: "INFO: Starting video stream: 1280 x 720, 30 fps, 299 kbps (AAC-eld) Front Camera"

DEBUG: "Stream command: ffmpeg -i xxxx -an -sn -dn"

Followed by: "ERROR: FFmpeg exited with code: 1 and signal: null (Error) Front Camera"

Does anybody have any ideas? Cheers

Device Type

Floodlight (Supported)

Plugin Version

v1.0.x (Supported)

HomeBridge Version

v1.3.x (Supported)

NodeJS Version

v16 (Supported)

Operating System

Raspbian 10+ (Supported)

Relevant log output

Stream command: ffmpeg -i xxxx -an -sn -dn" 

"ERROR: FFmpeg exited with code: 1 and signal: null (Error) Front Camera"
github-actions[bot] commented 2 years ago

Did you check this Common Issues pages ?

FIRE-SORCERER commented 2 years ago

Yes, unfortunately this did not help :(

fullphat commented 2 years ago

I have the same camera and the same issue (#242). If you open the RTSP url in VLC, does it work ok?

I'm running HomeBridge on macOS, so it's at least comforting to know the problem exists on Rasbian as well. 😊

FIRE-SORCERER commented 2 years ago

@fullphat it didn't give me a RTSP link but instead an RTSP. Will that still be okay to try? I'm not very familiar with RTSP and FFMPEG ahaha.

Yeah kinda annoying, seemed like I was getting somewhere then it just did a 180 :(

fullphat commented 2 years ago

Yes, RTSP is a bit like HTTP in that you get what looks like a url. If you have access to VLC, you can ask it to open a network stream. If you paste the full rtsp://... url in, it should open your camera's live stream.

In terms of support for the T8420, this camera seems to be pretty basic compared to other Eufy products (I wonder if it's something they've rebranded) so it seems to have been harder getting it supported. Version 1.0.8 supports most of it's features and I've modified the plugin to add support for the floodlights as well; it's just streaming that is missing now.

As the rtsp stream works in VLC, I suspect it's a problem with the arguments being passed to ffmpeg, but I haven't been able to fix it so far.

fullphat commented 2 years ago

Think I've fixed it. In streamingDelegate.js around line 353, if you force vcodec to be copy then the stream works in the Home app.

FIRE-SORCERER commented 2 years ago

ooooh, I'll check it out now. Can i ask how you force it to be copy?

fullphat commented 2 years ago

You can edit the "streamingDelegate.js" file directly on your system. Around line 353 I think it is, just change:

const vcodec = this.videoConfig.vcodec || 'libx264';

To:

const vcodec = 'copy';

Then restart HomeBridge or - if you're running the plugin as a separate bridge - just the bridge.

Note that streaming in the Home app doesn't always work, it probably works every 4 out of 5 attempts so if you get a time-out, just try again.

FIRE-SORCERER commented 2 years ago

just changed it over, fingers crossed!!

FIRE-SORCERER commented 2 years ago

@fullphat

Hey man it works! Thank you so much! Kinda sucks you can't use any of the features like toggle lights and what not but still so glad its working. Cheers!

fullphat commented 2 years ago

Glad it worked! 😊

Once I figure out how to do pull requests I'll put one in for the video streaming fix and one in for the floodlights fix.

schliemann commented 2 years ago

Will be fixed in https://github.com/samemory/homebridge-eufy-security/issues/321