docker-wyze-bridge icon indicating copy to clipboard operation
docker-wyze-bridge copied to clipboard

Bitrate Selection appears to be broken

Open fjrichman opened this issue 1 year ago • 9 comments

So no matter what bitrate I select using the environment options for Docker it seems the cameras just send the bitrate they want.

I was trying to match the cameras to the SD option in the app which the Wiki says is HD60. However setting the cameras to anything other than 200 or 180 for bitrate respectively always throws the following errors. They even occur when the app is closed so it isn't like the app is requesting a different bitrate that is somehow overriding it.

[backyard-bedroom-view] bitrate=200 does not match 60
Requesting frame_size=0, bitrate=60, fps=0
[backyard-kitchen-view] bitrate=200 does not match 60
Requesting frame_size=0, bitrate=60, fps=0
[driveway-cam] bitrate=180 does not match 60
Requesting frame_size=0, bitrate=60, fps=0

Edit: All 3 are v3 Pan Camd

fjrichman avatar Dec 28 '23 18:12 fjrichman

I found the v3 Pan will complain if not set to HD120. Manually set its quality to that. Not sure why it does not like the default HD180

jdeath avatar Dec 29 '23 21:12 jdeath

Can you post the firmware version? There seems to be a bug in newer versions of the firmware where the camera isn't reporting the correct bitrate.

mrlt8 avatar Dec 30 '23 14:12 mrlt8

Firmware and other details below. Thanks for checking. Also posted logs #1037 as been much less stable since adding this camera. [WyzeBridge] [+] Adding Basement Hall [HL_PAN3] [basement-hall] 📡 Getting 120kb/s HD stream (H264/20fps) via LAN mode (WiFi: 68%) FW: 4.50.4.7252 🔒 (DTLS) (2/3) [basement-hall] WARNING: Skipping smaller frame at start of stream (frame_size=1)

jdeath avatar Dec 30 '23 15:12 jdeath

Mine are all on 4.50.4.7252 as well.

Also uncertain why the one requires a different bitrate than the other two since the only difference between the three is the drive cam is further out from wifi.

fjrichman avatar Dec 30 '23 17:12 fjrichman

Thanks for the feedback. can someone try the dev branch to see if the bitrate is updating?

mrlt8 avatar Jan 01 '24 14:01 mrlt8

Forced homeassistant addon to use dev image: DOCKER-WYZE-BRIDGE v2.6.0 [x86_64] DEV BUILD [2024-01-01t13:39:55.260z] ec0a46a [WyzeBridge] [+] Adding Basement Hall [HL_PAN3] [basement-hall] 📡 Getting 180kb/s HD stream (H264/15fps) via LAN mode (WiFi: 50%) FW: 4.50.4.7252 🔒 [basement-hall] WARNING: Skipping wrong frame_size at start of stream [frame_size=1]

I forced bitrate to 180 and removed bitrate override and no bitrate errors either way! Thanks.

A few of my cameras are taking their time coming up and saw some new error messages, but the bitrate on the v3Cam seems fixed. I did see one bitrate error on another camera, but it fixed itself. Not sure why my cameras are not stable. I'll let it sit for a few hours.

[video] super slow [garage] WARNING: clear buffer [side-door] [Exception] Did not receive a frame for 20s [garage] [Exception] Did not receive a frame for 20s but then it does try to restart the connection and they eventually came up.

[WyzeBridge] ❌ '/side-door' stream is down Connection closed by remote. Closing connection. [side-door] [-20015] AV_ER_SESSION_CLOSE_BY_REMOTE [side-door] 📡 Getting 180kb/s HD stream (H264/20fps) via LAN mode (WiFi: 74%) FW: 4.25.1.316 🔒 [side-door] Re-encoding using libx264 [transpose='clock'] [side-door] WARNING: Skipping wrong frame_size at start of stream [frame_size=4]

[garage] [CONTROL] ERROR - error=AssertionError('Please call _connect() first!'), cmd='_bitrate' [garage] [Exception] Did not receive a frame for 20s

jdeath avatar Jan 01 '24 14:01 jdeath

Thanks! Some of those errors are related to the sync changes in the dev branch.

mrlt8 avatar Jan 01 '24 15:01 mrlt8

@mrlt8 Don't know if this is related to the reported issue, but I have noticed a bit rate issue when trying to use SD30. It will always use the last set HD bitrate.

For example if i run with no bitrate set at all then set SD30. it will request 180 bitrate (the default I guess) and give this error:

wyze-bridge  | [cam] bitrate='180' does not match 30
wyze-bridge  | [cam] Requesting frame_size=1, bitrate=30, fps=0

If I run HD60 then SD30:

wyze-bridge  | [cam] bitrate='60' does not match 30
wyze-bridge  | [cam] Requesting frame_size=1, bitrate=30, fps=0

If i run HD120 then SD30:

wyze-bridge  | [cam] bitrate='120' does not match 30
wyze-bridge  | [cam] Requesting frame_size=1, bitrate=30, fps=0

Actually hmm some further testing shows that even HD60 to SD30 can result in 120 so I guess it's not even consistent.

wyze-bridge  | [WyzeBridge] 🎉 Connecting to WyzeCam V3 - Cam on 192.168.1.28
wyze-bridge  | [WyzeBridge] 192.168.1.101 - - [08/Feb/2024 04:57:41] "GET /api/sse_status HTTP/1.1" 200 -
wyze-bridge  | [cam] 📡 Getting 30kb/s SD stream (H264/20fps) via LAN mode (WiFi: 73%) FW: 4.36.9.139 🔒
wyze-bridge  | [WyzeBridge] ✅ '/front-window-cam stream is UP! (3/3)
wyze-bridge  | [WyzeBridge] 📖 New client reading from cam
wyze-bridge  | [cam] bitrate='120' does not match 30

Seems like SD30 is broken?

This is on a WyzeCam V3 running firmware: 4.36.9.139

Also can SD also use higher bitrates then 30? Such as SD40? for possibly higher quality 360p?

drone540 avatar Feb 08 '24 05:02 drone540

Apparently I forgot to comment on this again. The update did fix the issues I was having originally.

fjrichman avatar Feb 08 '24 10:02 fjrichman