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

Performance issue on 6 cameras

Open guocity opened this issue 1 year ago • 10 comments

Try to troubleshoot for performance for 6 cameras, [docker-wyze-bridge] v2.3.13 wyze bridge video view is acceptable, but homekit video is unusable, rule out cpu, memory, network bottleneck, where can i find performance issue?

guocity avatar Aug 03 '23 00:08 guocity

Probably a network issue. The wyze cams tend to flood the wifi which can cause issues. IGMP and multicast related configs may need to be adjusted on your AP/router.

See also: https://github.com/mrlt8/docker-wyze-bridge/discussions/891 https://support.wyze.com/hc/en-us/articles/360031479211-ASUS-Routers-and-Airtime-Fairness https://support.wyze.com/hc/en-us/articles/360031124632--ASUS-Routers-and-Smart-Connect-

mrlt8 avatar Aug 03 '23 01:08 mrlt8

👍, i added 6 cameras to raspberry pi4, my cpu usage is at 50% is the following code going to make wyze-bridge use less cpu?

devices: - /dev:/dev environment: - ROTATE_DOOR=True - H264_ENC=h264_v4l2m2m

guocity avatar Aug 03 '23 02:08 guocity

It should help with re-encoding for the doorbell. may need to manually specify the devices on the pi:

        devices:
            - /dev/video10:/dev/video10
            - /dev/video11:/dev/video11
            - /dev/video12:/dev/video12

mrlt8 avatar Aug 06 '23 04:08 mrlt8

interesting, what are the video for?

pi@raspberrypi:/dev $ ls -ltra |grep video crw-rw---- 1 root video 10, 124 Aug 2 22:04 vchiq crw-rw---- 1 root video 10, 125 Aug 2 22:04 vcio crw-rw---- 1 root video 10, 122 Aug 2 22:04 vcsm-cma crw-rw---- 1 root video 238, 1 Aug 2 22:04 media1 crw-rw----+ 1 root video 81, 3 Aug 2 22:04 video16 crw-rw---- 1 root video 238, 0 Aug 2 22:04 media0 crw-rw----+ 1 root video 81, 0 Aug 2 22:04 video13 crw-rw----+ 1 root video 81, 9 Aug 2 22:04 video19 crw-rw---- 1 root video 238, 2 Aug 2 22:04 media2 crw-rw---- 1 root video 238, 3 Aug 2 22:04 media3 crw-rw----+ 1 root video 81, 6 Aug 2 22:04 video22 crw-rw----+ 1 root video 81, 8 Aug 2 22:04 video23 crw-rw----+ 1 root video 81, 12 Aug 2 22:04 video18 crw-rw----+ 1 root video 81, 2 Aug 2 22:04 video15 crw-rw----+ 1 root video 81, 11 Aug 2 22:04 video12 crw-rw----+ 1 root video 81, 7 Aug 2 22:04 video10 crw-rw----+ 1 root video 81, 1 Aug 2 22:04 video14 crw-rw----+ 1 root video 81, 4 Aug 2 22:04 video20 crw-rw----+ 1 root video 81, 5 Aug 2 22:04 video21 crw-rw----+ 1 root video 81, 10 Aug 2 22:04 video11 crw-rw----+ 1 root video 81, 13 Aug 2 22:04 video31 crw-rw---- 1 root video 237, 0 Aug 2 22:04 cec0 crw-rw---- 1 root video 237, 1 Aug 2 22:04 cec1

guocity avatar Aug 06 '23 17:08 guocity

I believe 10 11 and 12 are used for h264_v4l2m2m. Not sure about the others.

mrlt8 avatar Aug 08 '23 01:08 mrlt8

Thanks, load reduce from 60% to 40%

guocity avatar Aug 08 '23 21:08 guocity

I still have performance issue, with 40% cpu usage is anyway to optimize it?

here is docker-compose: wyze-bridge: container_name: wyze-bridge restart: unless-stopped image: mrlt8/wyze-bridge:latest ports: - 1935:1935 # RTMP - 8554:8554 # RTSP - 8888:8888 # HLS - 8889:8889 #WebRTC - 8189:8189/udp # WebRTC/ICE - 5000:5000 # WEB-UI devices: - /dev/video10:/dev/video10 - /dev/video11:/dev/video11 - /dev/video12:/dev/video12 environment: - ENABLE_AUDIO=True - SUBSTREAM=True - ROTATE_DOOR=True - H264_ENC=h264_v4l2m2m

high cpu

guocity avatar Aug 14 '23 23:08 guocity

Reduce the number of snapshots? Taking a snapshot requires the h264 to be decoded which can result in a CPU spike. We could try offloading that to the hardware decoder, but I'm not sure how much of a difference that might make. Will try to look into it.

mrlt8 avatar Aug 16 '23 04:08 mrlt8

@mrlt8 I want to try to use m1 mac, it perform much faster in scrypted, do you know there is any setting that i can do hardware decode h264 in macos? cpu usage is really high image

guocity avatar Sep 29 '23 04:09 guocity

I don't believe it's possible to access VideoToolbox via docker. Might be able to do the decoding in scrypted since it runs directly in macOS?

mrlt8 avatar Oct 02 '23 14:10 mrlt8