If you don’t mind spending money on a good product, the Insta360 Link is a fantastic webcam. It has a 3-axis gimbal which lets you pan, tilt, and rotate. It has an AI feature that’s actually useful - it can follow you as you move around.
Their control software only works on Windows and MacOS but I’m working on something similar for Linux.