I was able to display webcam on macOS by referring to the following source. However, I cannot get the aspect ratio of the camera image. Therefore, if I don’t know the camera’s aspect ratio in advance, the image becomes distorted. Is there a way to adjust the image size according to the camera device?