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.66k stars 168 forks source link

High CPU usage with v2.9.8 #1268

Closed Dleewee closed 4 months ago

Dleewee commented 4 months ago

Describe the bug

After updating from 2.9.7 to 2.9.8 I am seeing an increase of 15% CPU usage on the host ( going from 10% avg CPU usage up to 25% avg CPU usage). I tracked this increase to docker-wyze-bridge. Rolling back to 2.9.7 indeed dropped CPU usage back to previously expected values.

Environment (if applicable)

Below are the start-up logs for both versions. I notice there seems to be motion detection enabled in 2.9.8 which didn't seem to be present in the 2.9.7 log.

🚀 DOCKER-WYZE-BRIDGE v2.9.8 X86_64

[WyzeBridge] [WARN] Credentials are NOT set

  • Serving Flask app 'frontend'
  • Debug mode: off [WyzeBridge] 📚 Using 'auth' from local cache... [WyzeBridge] 📚 Using 'user' from local cache... [WyzeBridge] WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:5000
  • Running on http://172.30.33.2:5000 [WyzeBridge] Press CTRL+C to quit [WyzeBridge] 📚 Using 'cameras' from local cache... [WyzeBridge] [+] Adding Back Yard Cam [WYZE_CAKP2JFUS] [WyzeBridge] [+] Adding Front Yard Cam [WYZE_CAKP2JFUS] [WyzeBridge] starting MediaMTX 1.1.1 [WyzeBridge] 🎬 2 streams enabled [WyzeBridge] API Motion Events Enabled [interval=1.5] [WyzeBridge] 🎉 Connecting to WyzeCam V3 - Back Yard Cam on 192.168.10.XXX [WyzeBridge] 🎉 Connecting to WyzeCam V3 - Front Yard Cam on 192.168.10.X [back-yard-cam] 📡 Getting 180kb/s HD stream (H264/20fps) via LAN mode (WiFi: 94%) FW: 4.36.11.8391 🔒 [back-yard-cam] 🔊 Audio Enabled [Source=ALAW/16,000Hz] [back-yard-cam] [AUDIO] Re-Encode for RTSP compatibility [codec_out='pcm_mulaw'] [front-yard-cam] 📡 Getting 180kb/s HD stream (H264/20fps) via LAN mode (WiFi: 63%) FW: 4.36.11.8391 🔒 [front-yard-cam] 🔊 Audio Enabled [Source=ALAW/16,000Hz] [front-yard-cam] [AUDIO] Re-Encode for RTSP compatibility [codec_out='pcm_mulaw'] [back-yard-cam] WARNING: Skipping wrong frame_size at start of stream [frame_size=1] [WyzeBridge] ✅ '/back-yard-cam stream is UP! (3/3) [WyzeBridge] 📖 New client reading from back-yard-cam [front-yard-cam] WARNING: Skipping wrong frame_size at start of stream [frame_size=1] [WyzeBridge] ✅ '/front-yard-cam stream is UP! (3/3) [WyzeBridge] 📖 New client reading from front-yard-cam [WyzeBridge] 📕 Client stopped reading from back-yard-cam [WyzeBridge] 📖 New client reading from back-yard-cam [WyzeBridge] 📕 Client stopped reading from front-yard-cam [WyzeBridge] 📖 New client reading from front-yard-cam [front-yard-cam] [video] super slow [front-yard-cam] WARNING: clear buffer [WyzeBridge] [MOTION] Motion detected on front-yard-cam at 12:41:13 [WyzeBridge] Stopping 2 streams [back-yard-cam] WARNING: Audio pipe closed [WyzeBridge] Stream monitoring stopped [back-yard-cam] Stream stopped [front-yard-cam] WARNING: Audio pipe closed [front-yard-cam] Stream stopped [WyzeBridge] Stopping MediaMTX... [WyzeBridge] 👋 goodbye! [WyzeBridge] 🏠 Home Assistant Mode

🚀 DOCKER-WYZE-BRIDGE v2.9.7 X86_64

[WyzeBridge] [WARN] Credentials are NOT set

  • Serving Flask app 'frontend'
  • Debug mode: off [WyzeBridge] 📚 Using 'auth' from local cache... [WyzeBridge] 📚 Using 'user' from local cache... [WyzeBridge] 📚 Using 'cameras' from local cache... [WyzeBridge] [+] Adding Back Yard Cam [WYZE_CAKP2JFUS] [WyzeBridge] WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:5000
  • Running on http://172.30.33.2:5000 [WyzeBridge] Press CTRL+C to quit [WyzeBridge] [+] Adding Front Yard Cam [WYZE_CAKP2JFUS] [WyzeBridge] starting MediaMTX 1.1.1 [WyzeBridge] 🎬 2 streams enabled [WyzeBridge] API Motion Events Enabled [interval=1.5] [WyzeBridge] 🎉 Connecting to WyzeCam V3 - Front Yard Cam on 192.168.10.XXX [WyzeBridge] 🎉 Connecting to WyzeCam V3 - Back Yard Cam on 192.168.10.XXX [back-yard-cam] 📡 Getting 180kb/s HD stream (H264/20fps) via LAN mode (WiFi: 98%) FW: 4.36.11.8391 🔒 [back-yard-cam] 🔊 Audio Enabled [Source=ALAW/16,000Hz] [back-yard-cam] [AUDIO] Re-Encode for RTSP compatibility [codec_out='pcm_mulaw'] [front-yard-cam] 📡 Getting 180kb/s HD stream (H264/20fps) via LAN mode (WiFi: 54%) FW: 4.36.11.8391 🔒 [front-yard-cam] 🔊 Audio Enabled [Source=ALAW/16,000Hz] [front-yard-cam] [AUDIO] Re-Encode for RTSP compatibility [codec_out='pcm_mulaw'] [front-yard-cam] WARNING: Skipping wrong frame_size at start of stream [frame_size=1] [WyzeBridge] ✅ '/front-yard-cam stream is UP! (3/3) [WyzeBridge] 📖 New client reading from front-yard-cam [back-yard-cam] WARNING: Skipping wrong frame_size at start of stream [frame_size=1] [WyzeBridge] ✅ '/back-yard-cam stream is UP! (3/3) [WyzeBridge] 📖 New client reading from back-yard-cam [WyzeBridge] 📕 Client stopped reading from front-yard-cam [WyzeBridge] 📖 New client reading from front-yard-cam
dcw88 commented 4 months ago

I have the same issue. CPU usage went up to 70% after updating to v2.9.8. I have revert back to v2.9.7.

mrlt8 commented 4 months ago

This should be fixed in v2.9.9.

Dleewee commented 4 months ago

Afraid not, only using rtsp.

Possibly noteworthy: I do not have GPU acceleration on the host, so perhaps something changed causing transcoding?

On Thu, Jun 20, 2024, 7:38 PM mrlt8 @.***> wrote:

Are you by any chance using the HLS streams?

— Reply to this email directly, view it on GitHub https://github.com/mrlt8/docker-wyze-bridge/issues/1268#issuecomment-2181781215, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN4HLYDLNJPNJMWX6JUYBA3ZINYYXAVCNFSM6AAAAABJUOZXUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBRG44DCMRRGU . You are receiving this because you authored the thread.Message ID: @.***>

dcw88 commented 4 months ago

This should be fixed in v2.9.9.

Yes, I can confirm that v2.9.9 resolved the CPU high usage issue. Thanks!