Why did I get invalid credentials on camera connection?

The first obvious step is to verify the username and password works when logging in to the web browser directly to the camera.

There are some cameras that have a different set of credentials for ONVIF profile connections.  So check your camera settings directly to see if that is the case.

Lastly, if the camera time and the server time are off by a large amount this can sometimes return an invalid credentials message.  Check the camera time via the webpage and make sure it is close to the server.  Once they are and a connection is made the camera is configured, it will sync properly from then on out.