mrlt8 / docker-wyze-bridge

WebRTC/RTSP/RTMP/LL-HLS bridge for Wyze cams in a docker container
GNU Affero General Public License v3.0
2.58k stars 159 forks source link

Can't cast to chromecast #327

Closed dnestico closed 2 years ago

dnestico commented 2 years ago

I am trying to setup automation that casts my camera to my google nest hub, but for some reason, I can't figure out how to make it play, it just shows this screen:

(this is not my image but it is the same exact screen I see on my nest hub btw) 8fa1ac6f20ab321346f198284fcc44e0e8fddac6

Here is the simple stream camera automation:

Screen Shot 2022-03-24 at 2 14 58 AM

It didn't work with HLS checked or not, not sure why as the cameras are working fine and I can ask google to stream them just fine, I can also cast them from other apps like tiny cam pro, so not sure why this is happening.

dnestico commented 2 years ago

After further investigation, this appears to be a chromecast / nest hub issue. It only supports HLS and VP9.

https://developers.google.com/cast/docs/media

STILL for some reason when I cast the HLS stream, it works great on the browser, but the nest hub just won't play it even though it's an HLS stream. I tried using the media extractor and didn't fix it either.

So for now I have it stream a snapshot when my automation runs, but would be nice if you found a solution to this and maybe do something similar to what the "TinyCam Pro" app does, which that works perfectly for streaming.

mrlt8 commented 2 years ago

Not very familiar with casting, but have you tried both HLS streams on server:8888/cam-name and server:8888/cam-name/stream.m3u8?

Specs seem to support h264, so I don't think that's the issue, but you may be able to play around with some of the setting in rtsp-simple-server or tweak the ffmpeg input flags with FFMPEG_FLAGS.

dnestico commented 2 years ago

I don't have the rtsp-simple-server addon but I am going to try tweaking some of the FFMPEG_FLAGS settings now.

As you can see I tried both HLS streams and yup same result, will update you soon.

Screen Shot 2022-03-25 at 1 59 37 AM Screen Shot 2022-03-25 at 1 58 51 AM
dnestico commented 2 years ago

Currently trying this new addon I found that I think displays the cams as WebRTC and it works great, but the problem still exists, when I cast them cameras, still nothing, it even has it's own built-in cast service, still, that didn't even work sadly, it just stayed on the splash screen. Still trying to figure this out for a solution.

Maybe you can explain how the FFMPEG_FLAGS work, please? Thanks.

Addon: https://github.com/AlexxIT/WebRTC

mrlt8 commented 2 years ago

rtsp-simple-server is what we use internally to create the RTSP/RTMP/HLS streams and could be used to re-encode or convert the stream to a compatible format.

I'm an apple based user, so can't really comment on or test chrome cast compatibility.

dnestico commented 2 years ago

Ok so I have your wyze docker addon from the home assistant store, how exactly do I do this?

dnestico commented 2 years ago

Another question:

I enabled webrtc and fresh_data and it gave me the URLs this time unlike last time I got an error, but, all cameras went unavailable so I turned it back off.

How exactly do we use these URLs? That WebRTC integration I linked earlier does seem to be working great though, no sound though. Also Im still messing with things to figure out the casting issue. One more thing though, all the cameras would great and pretty much realtime with this WebRTC addon (no sound of course) but the doorbell, for some reason that isn't giving me a live feed, just a still snapshot. :/

I think it might be on the Chromecast/nest-hub side tbh so trying to figure out to maybe change the stream on the HA side that would make it work, not sure what to so far.

mrlt8 commented 2 years ago

I think you'll have have to Edit in YAML on the add-on's configuration page:

settings

The bridge just takes the raw h264 from the camera and pushes it out as RTSP/RTMP/HLS. There's a chance the nest doesn't like the h264 format that wyze is using, so you might be able to re-encode the raw video before it gets pushed out with ffmpeg:

FFMPEG_CMD: ffmpeg -f h264 -i - -vcodec libx264 -preset veryfast -f rtsp rtsp://0.0.0.0:8554/

NOTE: Re-encoding the stream will require much more computing resources.

Could also potentially use libvpx-vp9 to encode directly to vp9, but I couldn't get VLC to recognize the stream.

For tweaking rtsp-simple-server settings, see the readme for some examples.

As for webrtc, it basically gives you the same webrtc you'd get from the web view.

krysiswbk commented 2 years ago

You know what, that's not working for me any more either. Mind you that's what I've been using the past little while. Originally I had to cast the camera twice but that went away.. Not sure now

dnestico commented 2 years ago

I think you'll have have to Edit in YAML on the add-on's configuration page: settings

The bridge just takes the raw h264 from the camera and pushes it out as RTSP/RTMP/HLS. There's a chance the nest doesn't like the h264 format that wyze is using, so you might be able to re-encode the raw video before it gets pushed out with ffmpeg:

FFMPEG_CMD: ffmpeg -f h264 -i - -vcodec libx264 -preset veryfast -f rtsp rtsp://0.0.0.0:8554/

NOTE: Re-encoding the stream will require much more computing resources.

Could also potentially use libvpx-vp9 to encode directly to vp9, but I couldn't get VLC to recognize the stream.

For tweaking rtsp-simple-server settings, see the readme for some examples.

As for webrtc, it basically gives you the same webrtc you'd get from the web view.

So the FFMpeg command did not work on nest hub or even my dashboard, and CPU usage absolutely skyrocketed, after I put the command my streams actually just turned to snapshots and stopped playing so I had to remove it, also still on "1.1.2" while doing this, and CPU usage is pretty high at 80%+ which is weird because it wasn't before... and I've removed the command already and restarted the addon but my streams are back at least.

The VP9 command now had pretty good low CPU usage, again though but a little different this time I get "ERROR: No Video" on all cams.

Let me know if you need more info like logs, for now I'm removing those commands and going back to normal without them.. Neither worked with the nesthub and in fact, the VP9 command just wouldn't even start the stream.

Also based off threads I've seen the nesthub apparently works with mjpg streams too and I can confirm that because I've used tinycam to cast before. I am gonna try adding my cameras in to motion eye and see if I can use that mjpg URL, although didn't have much luck adding them to motioneye last time...

Back to more investigating!...

dnestico commented 2 years ago

@mrlt8 Update: I may have found what's causing the issue, maybe when you figure out webRTC this should not fix it. Or is it possible to make an option that can do the same thing on your addon?

But for now, I'm gathering more information on this and gonna try some workarounds soon.

Screen Shot 2022-03-27 at 11 24 08 PM

Source: https://github.com/gihad/streamer

mrlt8 commented 2 years ago

hmm, does adding a silent audio track help?

ffmpeg -fflags +flush_packets+genpts+discardcorrupt+nobuffer -i - -f lavfi -i anullsrc -c:a aac -vcodec copy -rtsp_transport tcp -f rtsp rtsp://0.0.0.0:8554
dnestico commented 2 years ago

Sooo, it looks like it killed the camera feeds πŸ€”

Or did I put it wrong?, cuz idk how adding a silent audio track would kill them, weird.

Screen Shot 2022-03-28 at 12 00 07 AM Screen Shot 2022-03-28 at 12 03 08 AM

-

Screen Shot 2022-03-27 at 11 59 48 PM
mrlt8 commented 2 years ago

Are the streams going up in the logs? Can you test in VLC or some other player?

dnestico commented 2 years ago

Here is the log, it seems like the cameras are going up unless I am reading this wrong which probably am, but, it did not work in VLC or chrome M3U8 plugin I have. Guess it didn't like the audio track or something...

Screen Shot 2022-03-28 at 12 10 58 AM Screen Shot 2022-03-28 at 12 10 23 AM Screen Shot 2022-03-28 at 12 13 10 AM

LOG:

2022/03/28 00:09:23 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V3 - Driveway on 192.168.2.30 (1/3) 2022/03/28 00:09:23 [Front Doorbell] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 80%) FW: 4.25.1.042 πŸ”’ (DTLS) (2/3) 2022/03/28 00:09:23 [Front Doorbell] WARNING: Skipping smaller frame at start of stream (frame_size=4) 2022/03/28 00:09:25 [Driveway] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 77%) FW: 4.36.8.32 πŸ”’ (DTLS) (2/3) 2022/03/28 00:09:25 [Driveway] WARNING: Skipping smaller frame at start of stream (frame_size=1) 2022/03/28 00:09:25 [Porch] [Errno 32] Broken pipe 2022/03/28 00:09:26 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Porch on 192.168.2.44 (1/3) 2022/03/28 00:09:28 [Garage Cam] [Errno 32] Broken pipe 2022/03/28 00:09:28 [Porch] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 76%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:09:28 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Garage Cam on 192.168.2.31 (1/3) 2022/03/28 00:09:31 [Garage Cam] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 78%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:09:38 [Driveway] [Errno 32] Broken pipe 2022/03/28 00:09:38 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V3 - Driveway on 192.168.2.30 (1/3) 2022/03/28 00:09:40 [Driveway] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 75%) FW: 4.36.8.32 πŸ”’ (DTLS) (2/3) 2022/03/28 00:09:40 [Driveway] WARNING: Skipping smaller frame at start of stream (frame_size=1) 2022/03/28 00:09:41 [Porch] [Errno 32] Broken pipe 2022/03/28 00:09:41 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Porch on 192.168.2.44 (1/3) 2022/03/28 00:09:42 [Front Doorbell] [Errno 32] Broken pipe 2022/03/28 00:09:43 [Garage Cam] [Errno 32] Broken pipe 2022/03/28 00:09:43 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam Doorbell - Front Doorbell on 192.168.2.104 (1/3) 2022/03/28 00:09:43 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Garage Cam on 192.168.2.31 (1/3) 2022/03/28 00:09:43 [Porch] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 75%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:09:45 [Garage Cam] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 78%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:09:45 [Front Doorbell] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 80%) FW: 4.25.1.042 πŸ”’ (DTLS) (2/3) 2022/03/28 00:09:46 [Front Doorbell] WARNING: Skipping smaller frame at start of stream (frame_size=4) 2022/03/28 00:09:53 [Driveway] [Errno 32] Broken pipe 2022/03/28 00:09:53 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V3 - Driveway on 192.168.2.30 (1/3) 2022/03/28 00:09:55 [Driveway] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 77%) FW: 4.36.8.32 πŸ”’ (DTLS) (2/3) 2022/03/28 00:09:55 [Driveway] WARNING: Skipping smaller frame at start of stream (frame_size=1) 2022/03/28 00:09:56 [Porch] [Errno 32] Broken pipe 2022/03/28 00:09:56 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Porch on 192.168.2.44 (1/3) 2022/03/28 00:09:58 [Garage Cam] [Errno 32] Broken pipe 2022/03/28 00:09:58 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Garage Cam on 192.168.2.31 (1/3) 2022/03/28 00:09:58 [Porch] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 75%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:01 [Garage Cam] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 79%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:05 [Front Doorbell] [Errno 32] Broken pipe 2022/03/28 00:10:05 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam Doorbell - Front Doorbell on 192.168.2.104 (1/3) 2022/03/28 00:10:08 [Front Doorbell] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 83%) FW: 4.25.1.042 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:08 [Driveway] [Errno 32] Broken pipe 2022/03/28 00:10:08 [Front Doorbell] WARNING: Skipping smaller frame at start of stream (frame_size=4) 2022/03/28 00:10:08 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V3 - Driveway on 192.168.2.30 (1/3) 2022/03/28 00:10:10 [Driveway] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 77%) FW: 4.36.8.32 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:10 [Driveway] WARNING: Skipping smaller frame at start of stream (frame_size=1) 2022/03/28 00:10:11 [Porch] [Errno 32] Broken pipe 2022/03/28 00:10:11 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Porch on 192.168.2.44 (1/3) 2022/03/28 00:10:13 [Garage Cam] [Errno 32] Broken pipe 2022/03/28 00:10:13 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Garage Cam on 192.168.2.31 (1/3) 2022/03/28 00:10:14 [Porch] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 74%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:16 [Garage Cam] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 80%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:23 [Driveway] [Errno 32] Broken pipe 2022/03/28 00:10:23 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V3 - Driveway on 192.168.2.30 (1/3) 2022/03/28 00:10:26 [Driveway] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 79%) FW: 4.36.8.32 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:26 [Driveway] WARNING: Skipping smaller frame at start of stream (frame_size=1) 2022/03/28 00:10:26 [Porch] [Errno 32] Broken pipe 2022/03/28 00:10:26 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Porch on 192.168.2.44 (1/3) 2022/03/28 00:10:27 [Front Doorbell] [Errno 32] Broken pipe 2022/03/28 00:10:27 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam Doorbell - Front Doorbell on 192.168.2.104 (1/3) 2022/03/28 00:10:28 [Garage Cam] [Errno 32] Broken pipe 2022/03/28 00:10:28 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Garage Cam on 192.168.2.31 (1/3) 2022/03/28 00:10:29 [Porch] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 75%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:30 [Front Doorbell] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 82%) FW: 4.25.1.042 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:30 [Front Doorbell] WARNING: Skipping smaller frame at start of stream (frame_size=4) 2022/03/28 00:10:31 [Garage Cam] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 78%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:38 [Driveway] [Errno 32] Broken pipe 2022/03/28 00:10:38 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V3 - Driveway on 192.168.2.30 (1/3) 2022/03/28 00:10:41 [Driveway] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 78%) FW: 4.36.8.32 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:41 [Driveway] WARNING: Skipping smaller frame at start of stream (frame_size=1) 2022/03/28 00:10:41 [Porch] [Errno 32] Broken pipe 2022/03/28 00:10:41 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Porch on 192.168.2.44 (1/3) 2022/03/28 00:10:43 [Garage Cam] [Errno 32] Broken pipe 2022/03/28 00:10:43 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Garage Cam on 192.168.2.31 (1/3) 2022/03/28 00:10:44 [Porch] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 76%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:45 [Garage Cam] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 81%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:49 [Front Doorbell] [Errno 32] Broken pipe 2022/03/28 00:10:49 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam Doorbell - Front Doorbell on 192.168.2.104 (1/3) 2022/03/28 00:10:52 [Front Doorbell] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 83%) FW: 4.25.1.042 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:52 [Front Doorbell] WARNING: Skipping smaller frame at start of stream (frame_size=4) 2022/03/28 00:10:53 [Driveway] [Errno 32] Broken pipe 2022/03/28 00:10:53 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V3 - Driveway on 192.168.2.30 (1/3) 2022/03/28 00:10:55 [Driveway] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 76%) FW: 4.36.8.32 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:56 [Driveway] WARNING: Skipping smaller frame at start of stream (frame_size=1) 2022/03/28 00:10:56 [Porch] [Errno 32] Broken pipe 2022/03/28 00:10:56 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Porch on 192.168.2.44 (1/3) 2022/03/28 00:10:58 [Garage Cam] [Errno 32] Broken pipe 2022/03/28 00:10:58 [Porch] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 73%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:10:58 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Garage Cam on 192.168.2.31 (1/3) 2022/03/28 00:11:00 [Garage Cam] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 78%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:11:08 [Driveway] [Errno 32] Broken pipe 2022/03/28 00:11:09 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V3 - Driveway on 192.168.2.30 (1/3) 2022/03/28 00:11:10 [Driveway] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 77%) FW: 4.36.8.32 πŸ”’ (DTLS) (2/3) 2022/03/28 00:11:11 [Driveway] WARNING: Skipping smaller frame at start of stream (frame_size=1) 2022/03/28 00:11:11 [Porch] [Errno 32] Broken pipe 2022/03/28 00:11:11 [Front Doorbell] [Errno 32] Broken pipe 2022/03/28 00:11:12 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam Doorbell - Front Doorbell on 192.168.2.104 (1/3) 2022/03/28 00:11:12 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Porch on 192.168.2.44 (1/3) 2022/03/28 00:11:13 [Garage Cam] [Errno 32] Broken pipe 2022/03/28 00:11:14 [WyzeBridge] πŸŽ‰ Connecting to WyzeCam V2 - Garage Cam on 192.168.2.31 (1/3) 2022/03/28 00:11:14 [Front Doorbell] πŸ“‘ Getting 120kb/s HD stream (20fps) via LAN mode (WiFi: 83%) FW: 4.25.1.042 πŸ”’ (DTLS) (2/3) 2022/03/28 00:11:14 [Porch] πŸ“‘ Getting 120kb/s HD stream (15fps) via LAN mode (WiFi: 77%) FW: 4.9.8.1002 πŸ”’ (DTLS) (2/3) 2022/03/28 00:11:14 [Front Doorbell] WARNING: Skipping smaller frame at start of stream (frame_size=4)

mrlt8 commented 2 years ago

Sorry, that needs to go in FFMPEG_CMD not FFMPEG_FLAGS:

vlc
dnestico commented 2 years ago

So I can definitely see that you added an audio track via VLC, but STILL, it somehow won't show the God damn camera on the nest hub!!

Not gonna lie, I thought this would be the fix and it somehow isn't sadly, so dumb.

Screen Shot 2022-03-28 at 12 49 43 AM
mrlt8 commented 2 years ago

Were you able to get gihad/streamer to work with your nest?

Looks like they're using aevalsrc which would be something like this:

ffmpeg -loglevel verbose -fflags +flush_packets+genpts+discardcorrupt+nobuffer -i - -f lavfi -i aevalsrc=0 -c:a aac -c:v copy -rtsp_transport tcp -f rtsp rtsp://0.0.0.0:8554
mrlt8 commented 2 years ago

btw, I noticed you're using homeassistant.local but maybe the nest has some weird DNS thing going on? Have you tried using the IP of the HA machine instead?

dnestico commented 2 years ago

THIS WORKED!!!! πŸŽ‰ kinda....

So it worked... but sometimes. because it seems to work great, but only my 2/4 cams and also on the camera it did work on sometimes it doesn't actually load... haha. One is a V2 other is a V3. It's unfortunately delayed by a minute too

But the good news is now that you know where the success is you can work with this if you choose too, hopefully making all the cameras work eventually. Thanks!

Screen Shot 2022-03-28 at 1 54 23 AM Screen Shot 2022-03-28 at 1 51 47 AM
mrlt8 commented 2 years ago

Out of curiosity, was the audio channel required?

Also see https://github.com/aler9/rtsp-simple-server#decrease-delay

You may be able to play around with the FFMPEG_CMD to see if you might be able to reduce the delay.

krysiswbk commented 2 years ago

I am not sure what cameras you are using but casting works fine with V3 and doorbell. I personally cast from wyze bridge daily. I don't use ffmpeg cmds I don't need to run a ghost audio feed. Please don't spend too much time there! I can cast both hls and non hls! 16484478170598063167267934264241

Please see this note on the cast page. I have Casa Cloud so my earlier issue was my "internal url"

Chromecasts generally ignore DNS servers from DHCP and will instead use Google’s DNS servers, 8.8.8.8 and 8.8.4.4. This means media URLs must either be specifying the IP-address of the server directly, e.g. http://192.168.1.1:8123/movie.mp4, or be publicly resolvable, e.g. http://homeassistant.internal.mydomain.com:8123/movie.mp4 where homeassistant.internal.mydomain.com resolves to 192.168.1.1. A hostname which can’t be publicly resolved, e.g. http://homeassistant.local:8123/movie.mp4 will fail to play.

This is important when casting TTS or local media sources; the cast integration will cast such media from the external_url if configured, otherwise from the Home Assistant Cloud if configured, otherwise from the internal_url. Note that the Home Assistant Cloud will not be used if an external_url is configured.

dnestico commented 2 years ago

@mrlt8 So it randomly stopped working and now just worked again on my V2, don't think audio was required because I pulled up the dashboard at the same time and audio icon you put wasn't on that camera that was being casted.

Now to figure out why it works sometimes, and sometimes doesn't.

Also is this what you want me to put for reducing the delay?

ffmpeg -i rtsp://original-stream -pix_fmt yuv420p -c:v libx264 -preset ultrafast -b:v 600k -max_muxing_queue_size 1024 -g 30 -f rtsp rtsp://localhost:$RTSP_PORT/compressed

Screen Shot 2022-03-28 at 2 14 48 AM
dnestico commented 2 years ago

@krysiswbk

This is good information, thank you.

Would you say it always works anytime you cast your cameras? And so when you go to cast you are using a URL like this right?

http://192.168.1.242:8888/porch/stream.m3u8

And I do actually have nabu casa cloud subscription setup on external URL so maybe I could play around with that...

Just wondering how did you make it work all the time because it wasn't working for me for the longest time until I started using these ffmpeg cmd things I was given by @mrlt8. Even right now I wouldn't say its 100% success rate because sometimes the feed just doesn't load.

And another question, are you using a WebRTC plugin like I am, or just standard HA camera integration?

Here is what my configuration file looks like btw, if that helps.

`

stream

stream:

ffmpeg

ffmpeg: ffmpeg_bin: /usr/bin/ffmpeg

camera

camera:

`

krysiswbk commented 2 years ago

@

@krysiswbk

This is good information, thank you.

Would you say it always works anytime you cast your cameras? And so when you go to cast you are using a URL like this right?

http://192.168.1.242:8888/porch/stream.m3u8

And I do actually have nabu casa cloud subscription setup on external URL so maybe I could play around with that...

Just wondering how did you make it work all the time because it wasn't working for me for the longest time until I started using these ffmpeg cmd things I was given by @mrlt8. Even right now I wouldn't say its 100% success rate because sometimes the feed just doesn't load.

Here is what my configuration file looks like btw, if that helps.

` #stream stream:

ffmpeg ffmpeg: ffmpeg_bin: /usr/bin/ffmpeg

camera camera:

  • platform: ffmpeg input: rtsp://127.0.0.1:8554/porch name: Porch cam
  • platform: ffmpeg input: rtsp://127.0.0.1:8554/garage-cam name: Garage cam
  • platform: ffmpeg input: rtsp://127.0.0.1:8554/front-doorbell name: Doorbell cam
  • platform: ffmpeg input: rtsp://127.0.0.1:8554/driveway name: Driveway cam
  • platform: generic stream_source: rtsp://user:pass@127.0.0.1:8554/porch name: GENERIC Porch cam

`

The ffmpeg was way too resource heavy I took them all off with the exception of a back up of my doorbell cam as that one is slow and was hoping to get it closer to other cams in regards to timestamps. ive been playing but no luck.

my wyzebridge config has no flags or cmds

its not perfect but it works 95%

dnestico commented 2 years ago

@krysiswbk

Thanks for sharing, I am actually using one "generic" stream and noticed it loads quicker, I am gonna use this info you shared and mess around for my own setup.

I still have that one cmd in my bridge config but will start playing around soon and remove it too.

I will probably keep the WebRTC addon I have that I think converts my cams to WebRTC because it loads the feeds in 2 seconds and there is little delay.

frenck commented 2 years ago

Hey @frenck, if you have time, could you help out here please, I can't get my camera to stream on my nest hub, as you can see in the thread here the developer has done a lot to try and fix it but still no luck so far.

(sorry if I shouldn't of @ ed you btw just trying to get this fixed and didn't know how to @ home assistant GitHub page)

Sorry, I have no clue what this project is, what I can do, how I am connected/affiliated with this all, or why I am pulled into this issue.

In general, I cannot appreciate being demanded/summoned. Please don't. I generally wake up to around 200 GitHub notifications each day, this one was really not needed. Thanks πŸ‘

krysiswbk commented 2 years ago

@dnestico no worries! I played with ffmpeg for weeks i couldnt see the benefit over generic. The ffmpeg streams take 5-10 seconds to load in the app for me so forget casting... it was almost a full minute delay. Now when someone presses my doorbell its on my display within seconds ;).

Some things to note - i think its important to identify the IP in the config vs calling it locally (127. 0.0.1) I have also found the need to add a "turn media player off" before the cast. This tweak has added alot of efficiency.. Now I turn media off - mute media - cast - unmute as a script.. pretty slick in action lol

dnestico commented 2 years ago

@krysiswbk Sweet thanks.

Guess this is not technically an issue anymore so can be closed. I'm for sure bookmarking this is as I plan to re-read everything and overhaul my camera set up soon, and it'll be using frigate too for AI detection, I think I'll use frigates card.

Thanks.

krysiswbk commented 2 years ago

@krysiswbk Sweet thanks.

Guess this is not technically an issue anymore so can be closed. I'm for sure bookmarking this is as I plan to re-read everything and overhaul my camera set up soon, and it'll be using frigate too for AI detection, I think I'll use frigates card.

Thanks.

Any luck casting for you?

dnestico commented 2 years ago

I'm still running the same setup so same results, works sometimes, not always

I plan to change it soon with the changes your suggested then I'll do some more testing.

dnestico commented 2 years ago

@krysiswbk I have switched my cameras to "generic" and can confirm streams load near instantly, @mrlt8 also the latest update has for Wyze docker has brought the delay down for most cameras to 2-5 seconds, I hope this will fix my snapshots not being on time. But have only been running it for like 5 minutes though so maybe I'll report back in a couple of hours on things.

dnestico commented 2 years ago

Another update, I've fully switched my cameras to "generic" as well have removed the webRTC addon and my cameras are back in near real-time!

Eventually, I will have to test the streaming capabilities to the nest hub when I have time but for now, I have a cast snapshot automation for my doorbell which works good.

krysiswbk commented 2 years ago

Another update, I've fully switched my cameras to "generic" as well have removed the webRTC addon and my cameras are back in near real-time!

Eventually, I will have to test the streaming capabilities to the nest hub when I have time but for now, I have a cast snapshot automation for my doorbell which works good.

with the new update you can remove the camera config from your yaml if using generic. The casting feature is even faster now. literally 2 seconds. When compared to wyzes native casting ability it blows it out of the water. 30-60 seconds via Wyze. 2 seconds through wyze bridge and HA

dnestico commented 2 years ago

Yep, I have removed the YAML actually, thanks!

I'll have to try it out soon.