Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FORCE_FPS doesn't appear to be working #1161

Closed
jarrah31 opened this issue Apr 25, 2024 · 9 comments · Fixed by #1184
Closed

FORCE_FPS doesn't appear to be working #1161

jarrah31 opened this issue Apr 25, 2024 · 9 comments · Fixed by #1184
Labels
bug Something isn't working

Comments

@jarrah31
Copy link

Hello,

I have Wyze-bridge 2.8.1 running as a Docker container. It connects to the following three Wyze cams:

Wyze Cam v3 - v4.36.11.8391
Wyze Cam v3 Pro - v4.58.11.8391
Wyze Cam Pan v3 - v4.50.4.9222

In my Docker environment variables I have the following set:

    environment:
      # [REQUIRED] Fill the following two lines:
      - WYZE_EMAIL=$WYZE_EMAIL
      - WYZE_PASSWORD=$WYZE_PASSWORD
      - RTSP_PATHS_ALL_READUSER=$WYZE_RTSP_USER
      - RTSP_PATHS_ALL_READPASS=$WYZE_RTSP_PASS
      - FORCE_FPS_FRONTCAMTOP=10
      - FORCE_FPS_GARAGECAM=10
      - FORCE_FPS_KITCHENCAMPAN=10
      - TOTP_KEY=$WYZE_TOTP
      - NET_MODE=LAN
      - ENABLE_AUDIO_GARAGECAM=True
      - MQTT_HOST=${MQTT_HOST}
      - MQTT_AUTH=${MQTTAUTH}
      - MQTT_TOPIC=wyzebridge
      - MQTT_DTOPIC=homeassistant
      # - FRESH_DATA=true
      # - AUDIO_CODEC=AAC
      - WB_IP=${DOCKER_HOST_IP}
      - DEBUG_FFMPEG=true

I use the RTSP streams to feed into SecuritySpy which is reporting 20fps for all three cameras.

Looking at the docker logs, on startup it says the following:

[WyzeBridge] [CONTROL] Connecting to kitchencampan
[kitchencampan] Attempting to force fps=10
[kitchencampan] Requesting frame_size=0, bitrate=180, fps=10
[kitchencampan] 📡 Getting 180kb/s HD stream (H264/10fps) via LAN mode (WiFi: 56%) FW: 4.50.4.9222 🔒
[kitchencampan] [CONTROL] Attempting to SET: rotary_degree=up
[kitchencampan] WARNING: Skipping wrong frame_size at start of stream [frame_size=1]
[WyzeBridge] ✅ '/kitchencampan stream is UP! (3/3)
[kitchencampan] [CONTROL] response=None
[WyzeBridge] [CONTROL] Disconnecting from kitchencampan
[WyzeBridge] ❌ '/kitchencampan' stream is down
[kitchencampan] Attempting to force fps=10
[kitchencampan] Requesting frame_size=0, bitrate=180, fps=10
[kitchencampan] 📡 Getting 180kb/s HD stream (H264/10fps) via LAN mode (WiFi: 48%) FW: 4.50.4.9222 🔒
[kitchencampan] WARNING: Skipping wrong frame_size at start of stream [frame_size=1]
[kitchencampan] [video] super slow
[kitchencampan] WARNING: clear buffer
[WyzeBridge] ✅ '/kitchencampan stream is UP! (3/3)
[WyzeBridge] 📖 New client reading from kitchencampan
[WyzeBridge] 📖 New client reading from kitchencampan
[WyzeBridge] 📕 Client stopped reading from kitchencampan

[frontcamtop] Attempting to force fps=10
[frontcamtop] Requesting frame_size=3, bitrate=180, fps=10
[frontcamtop] 📡 Getting 180kb/s 2K stream (H264/10fps) via LAN mode (WiFi: 56%) FW: 4.58.11.8391 🔒
[frontcamtop] WARNING: Skipping wrong frame_size at start of stream [frame_size=1]
[frontcamtop] [video] super slow
[frontcamtop] WARNING: clear buffer

[garagecam] Attempting to force fps=10
[garagecam] Requesting frame_size=0, bitrate=180, fps=10
[garagecam] 📡 Getting 180kb/s HD stream (H264/10fps) via LAN mode (WiFi: 63%) FW: 4.36.11.8391 🔒
[garagecam] Re-encoding audio for compatibility with WebRTC in MTX
[garagecam] 🔊 Audio Enabled - ALAW > LIBOPUS/16,000Hz
[garagecam] WARNING: Skipping wrong frame_size at start of stream [frame_size=1]

As you can see here it tries for force 10fps, however when I look at the Wyze-Bridge web GUI and select the 'I' icon on each camera, it says fps = 20:

videoParm	{ "bitRate": "30", "fps": "20", "horizontalFlip": "1", "logo": "2", "resolution": "2", "time": "1", "type": "H264", "verticalFlip": "1" }

This is also backed up in the SecuritySpy app:

Capto_Annotation

Trying other versions seems to work better:

v2.6.0 is close to 10fps

Capto_Capture 2024-04-25_07-36-09_PM

v2.7.0 does 20fps with one of the cams

Capto_Capture 2024-04-25_07-38-41_PM

The main reason for reporting this is because it helps reduce my wifi bandwidth, especially for the Pan Cam because that is further away from the router. (or does it? I guess the camera always sends 20fps and wyze bridge just re-encodes as 10fps?)

@mrlt8
Copy link
Owner

mrlt8 commented Apr 27, 2024

hmm I'll have to look into this.

@mrlt8 mrlt8 added the bug Something isn't working label Apr 27, 2024
@jarrah31
Copy link
Author

Thank you, hopefully it’s not just me seeing this difference.

mrlt8 added a commit that referenced this issue May 4, 2024
@mrlt8
Copy link
Owner

mrlt8 commented May 4, 2024

Could you try the latest dev build to see if that helps?

I noticed that FPS was a little sticky on some cameras, and I needed to reboot the camera via the webUI for the FPS to updates sometimes.

@jarrah31
Copy link
Author

jarrah31 commented May 4, 2024

Thanks for the update, I should be able to try this on Monday when back home.

@mrlt8
Copy link
Owner

mrlt8 commented May 8, 2024

@jarrah31 could you try the dev branch to see if that helps?

@mrlt8 mrlt8 linked a pull request May 12, 2024 that will close this issue
mrlt8 added a commit that referenced this issue May 12, 2024
* Sign motion event request #1125

* use device id instead of mac #1125

* remove wrong flags from mkfifo #1174

* less aggressive flush #1159 #1167

* Use K10052 for setting FPS #1161

* Refactor bits for going above 255 for quality

* Revert ffmpeg changes #1159 #1167

* version is obsolete

* default quality to hd180

* Update Wyze iOS App version from v2.44.5.3 to v2.50.6.1 (#1176)

* use struct pack

* Token based auth over the webUI

* Fix redirect for Home Assistant Ingress

* Use request headers to fix redirect for HA

* Change GET to POST for webhooks data

* Deprecate ifttt_webhook in favor of webhooks

* use yml for HA config and make credentials optional

* keep trying to identify audio #1172

* Snapshot on motion and push to mqtt #709 #970

* Add event time to motion message

* refactor auth

* EVENT_API option #1125

* Add additional headers  #1125

* Audio sync with higher bitrate

* Debug api request #1125

* Update api.py

* only debug on error

* Tweak audio sync

* don't raise error on lost frame

* clear buffer if out of sync

* Unique macs only #1125

Co-Authored-By: Cameron <32912464+kiwi-cam@users.noreply.github.com>

* Require auth by default and block non-ingress access #1181

* Allow non-ingress access with auth #1181

* Remove retain flag from commands #1182

* update webrtc to work with auth streams

* Add WB_API and rename WEB to WB #1181

WEB_USERNAME > WB_USERNAME
WEB_PASSWORD > WB_PASSWORD

* HA move /config/wyze-bridge/ to /config/

* Don't notify substream event and remove v2 #1125

* WebUI Auth related config for HA

* Don't retain discovery message? #1182

* Case sensitive credentials for WebUI

* changelog and readme

---------

Co-authored-by: Cameron <32912464+kiwi-cam@users.noreply.github.com>
@jarrah31
Copy link
Author

jarrah31 commented May 12, 2024

Very sorry @mrlt8 it's been a busy week at work and I clean forgot to test the dev branch. I've now just installed 2.9.0 and can confirm FORCE_FPS now works great. Thank you very much!

@jdeath
Copy link

jdeath commented May 17, 2024

how set force_fps in home assistant mode (using latest dev container)? Tried
FORCE_FPS_KITCHENCAMPAN: 10
and
FORCE_FPS:10 under cam_options

neither seems to work (do not see it trying to request lower fps in log).

I am trying to reduce memory usage. High usage of the bridge appears to crash my system.

@mrlt8
Copy link
Owner

mrlt8 commented May 17, 2024

hmm, I think we're missing the fps options for HA. will have to look into that!

edit: in the meantime, you should be able to use the api or MQTT to change the FPS manually.

mrlt8 added a commit that referenced this issue May 17, 2024
mrlt8 added a commit that referenced this issue May 17, 2024
mrlt8 added a commit that referenced this issue May 17, 2024
* Tweak AV sync and ffmpeg cmd #1175 #1196 #1194 #1193 #1186

* Catch AccessTokenError

* don't drop timestamp #1175 #1196 #1194 #1193 #1186

* Don't use_wallclock_as_timestamps  #1175 #1196 #1194 #1193 #1186

* keep audio in sync #1175 #1196 #1194 #1193 #1186

* Ignore whitespaces in api key/id #1188

* Remove quotes from credentials #1158

* HA Add FORCE_FPS option #1161

* FORCE_FPS option for all cameras #1161

* changelog
@jdeath
Copy link

jdeath commented May 18, 2024

2.9.2 works great for fps in HA. Lowered my memory usage by using 5fps. Hopefully no more crashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants