Depending on your definition of "good quality", you might find this project useful: https://thingino.com/

Most cameras on that list are low cost, typically with 4-5MP sensors. They don't compete on the high end in terms of image quality but you will have an open source firmware stack with root access over SSH.

Models from Eufy, Cinnado, Jooan, TP-Link, WUUK, Galayou are relatively easy to source on Amazon or Aliexpress.