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

Bitrate Overflow Issue #1250

Closed prodemydotcom closed 2 weeks ago

prodemydotcom commented 3 weeks ago

Describe the Bug

When the bitrate is set to a value up to 255, the API response is correct: REST API URL: http://127.0.0.1:5000/api/v4/bitrate

{
  "command": "bitrate",
  "payload": null,
  "response": 255,
  "status": "success",
  "value": 255
}

However, setting the bitrate to any value over 255 causes an overflow: REST API URL: http://127.0.0.1:5000/api/v4/bitrate/288

{
  "command": "bitrate",
  "payload": "288",
  "status": "success",
  "value": 288
}

The API reports success, but querying the current bitrate shows an incorrect value due to overflow: REST API URL: http://127.0.0.1:5000/api/v4/bitrate

{
  "command": "bitrate",
  "payload": null,
  "response": 32,
  "status": "success",
  "value": 32
}

The value 32 is the result of overflow, as 288 wraps around within an 8-bit limit (255 + 32 + 1 = 288).

This overflow causes wyze-bridge to repeatedly attempt to correct the bitrate:

wyze-bridge  | [v4] bitrate=32 does not match 288
wyze-bridge  | [v4] Requesting frame_size=3, bitrate=288, fps=0

Expected Behavior

Wyze-bridge should handle the overflow correctly and not attempt to correct the bitrate if the issue is due to overflow.

Environment

Thank you for looking into this issue!

mrlt8 commented 3 weeks ago

Sorry, I'm unable to replicate. Please ensure you're running the latest version of the bridge.

prodemydotcom commented 2 weeks ago

Can confirm latest version does not have this issue. Thank you!