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.46k stars 151 forks source link

RTSP stream (or any stream) from Wyze Cam V3 Pro won't play on Android Tablet (Only!) #1072

Open aquariuz23 opened 6 months ago

aquariuz23 commented 6 months ago

Hello all,

I am personally at my wits end trying to figure this out, and hopefully someone here can give me an answer as to why this is happening. I don't know a whole lot about how these things work, so please bare with me.

the TL:DR version - I'm just trying to get my Cam V3 Pro live stream feeds to work with my Home Assistant on my Android tablet. Neither RTSP, RTMP, WebRTC, HLS work on my tablets. I have a 2022 Samsung A8, an old Lenovo tablet (don't remember the model), and an Nvidia Shield Tablet. The live streams won't load at all on the Dashboard, just a static image. When I click on the image and press play, the stream never loads and the loading circle just keeps spinning. However, the live streams from my V3 Pro works just fine on either my Desktop Browser or my iPhone or my old Pixel 3XL phone.

The long version - I'm trying to set up a dashboard on my Android Tablets that will show live streams of my cams around the house. As mentioned above, I have 3 android tablets. I actually purchased the Samsung A8 because I thought the issue I was having above might be related to old hardware, but apparently it isn't.

After setting the streams up as generic cameras in HA, I am able to see all the live streams running normally on my desktop browser as well as on my iphone and Pixel 3XL, both the streams from V3 Pro as well as regular V3 cams. However, when I set up the dashboard on my android tablets, the live streams from V3 Pro cams will not load at all.

As mentioned above, the feed on the dashboard will just be a static image that won't refresh, and when I click on it, the video never loads at all. I even try installing WebRTC add-on on my HA to try and see if that helps, but it didn't. However, live streams from V3 cams work on the android tablets, which I don't understand what the difference necessarily is. I'm aware that V3 Pro is a 2K camera, but I don't think that would matter since if I'm not mistaken, RTSP doesn't support 2K right? And why would the live stream of the V3 Pro work on the Pixel 3XL, but not on the Samsung A8?

Any suggestions on what I should do? I'll be pretty sad if I can't get this to work because not only is my Wyze Doorbell Pro not supported (yet), now my V3 Pro cams aren't working as well :(

mrlt8 commented 6 months ago

hmm that is strange since the V3 camera is working on the tablet. Can you double check your settings to make sure the pro cam is configured the same way as the V3? You could also try accessing the WebRTC/HLS stream in a browser via the bridge's WebUI to see if it's a codec issue with the 2K stream.

Another thing you could try is to set the ON_DEMAND option in the add-on config to false so that the bridge will keep the connection alive.

aquariuz23 commented 6 months ago

hmm that is strange since the V3 camera is working on the tablet. Can you double check your settings to make sure the pro cam is configured the same way as the V3? You could also try accessing the WebRTC/HLS stream in a browser via the bridge's WebUI to see if it's a codec issue with the 2K stream.

Another thing you could try is to set the ON_DEMAND option in the add-on config to false so that the bridge will keep the connection alive.

Hi @mrlt8, thank you very much for your reply and suggestions.

I did try accessing the webRTC/HLS streams in a browser directly via the bridge's webUI (where I click on Streams on the camera I want and then choosing either webRTC or HLS and a new tab opens with the videos stream), but it doesn't make a difference; the stream for the V3 Pro will still not load but just sits there "loading" forever.

disabling (sliding to off/grey) the On_Demand option also didn't change anything when it comes to loading the V3 Pro stream on the tablet.

However, thanks to your suggestion to disable On_Demand, I noticed for the first time the "Show unused optional configuration options" option. Enabling it reveals the "Enable sub-stream" option, and enabling that provided me with sub-stream options for all the cameras, including the V3 Pro.

And now, accessing the webRTC/HLS streams of the sub-stream version of the V3 Pro camera in the tablet's browser works! The video stream now loads up almost instantly on the tablet, and the live stream on the dashboard works as well.

There are a few things to note though, that hopefully can be resolved maybe with some changes in my settings -

  1. Sub-stream video quality is extremely poor. There is a lot of aliasing and jagged lines. The quality almost looks like an oversharpen 360p quality. I've posted comparisons of normal and sub-stream quality below. I don't mind using sub-stream stream, but it doesn't really help if the quality is almost unusable. image image

  2. I'm not sure how to describe this, but there seems to be a bit of a stutter in the sub-stream video. Looking at the seconds in the timestamp, it seems that for every second, the video speeds up another second. so for example, at 31 seconds it'll be normal, then it speeds through 32 and jumps immediately to 33 seconds, sits at 33 seconds at a normal 1-second interval, and then again speeds through 34 to get to 35 and so on and so forth. Sometimes, it also does the whole time stutter thing where it bounces back and forth between different times repeatedly before fixing itself. I recorded a screengrab to show clearer what I mean. https://github.com/mrlt8/docker-wyze-bridge/assets/48851656/9ef20d62-a14b-4f47-8d56-bf989f01f7db

  3. Surprisingly, on the desktop browser and on the iphone, the sub-stream is one to two seconds behind the normal stream. Not really an issue but I thought I'd share it with you.

Is there a way to increase the quality a bit for the sub-stream? If I can get it too look good enough where things are not blocky and jagged, I think my issue will be resolved, although of course ideally I'd prefer to use the normal stream of the V3 Pro rather than the sub-stream.

Thanks again for your help!

mrlt8 commented 6 months ago

You can adjust the bitrate for the substream, but the substream resolution is actually 360p so there isn't much you can do about the aliasing.

Not sure why android can't playback 2k, but you could try re-encoding the 2k video for compatibility with android using a custom ffmpeg command.

aquariuz23 commented 5 months ago

Thank you again for the suggestions @mrlt8. How do I go about adjusting the bitrate for the substream? Maybe 360p with a better bitrate might just suffice for viewing on the tablet.

I also can try re-encoding the 2K video but I'm not familiar with ffmpeg, still new with all these things. Any recommendations on where I can learn more about this?

mrlt8 commented 5 months ago

You can set the quality for the one camera by adding something like this to the "Camera Specific Options":

- CAM_NAME: Outdoor Cam 1
  QUALITY: SD180

Or you could try toggling the FORCE_ENCODE option to see if that helps, but note that decoding/encoding the stream will require more CPU processing on the server.