Raspberry Pi 3B+ can’t handle the load. You will need to upgrade to a much faster CPU if you want reliable motion detection and recording from cameras. I’m using the Asus Tinkerboard S (like a slightly faster rPI3B) and it displays video at 5fps and records at 2fps. Not very useful at the moment.
Doing a straight RTSP stream from the camera to my laptop using VLC media player shows a smooth 30fps, so I don’t think it is the camera or wifi issue.