The modern notebook PC is equipped with a "camera" at a considerable proportion.The reason is that video chat like FaceTime is required, but it is a camera, so there is no problem using it for other purposes.Rather, video chat varies greatly from person to person, and people who do not use it are not used at all, so it is better to find something meaningful.
When I searched for people, I found a public domain software called "ImageSnap" (link).This is a CUI -based tool that works if there is a camera that is recognized as a video device on a Mac, such as ISIGHT and FaceTime HD Camera.
The installation method is OK if the source code is compiled or installed with Homebrew as follows.In the case of Homebrew, it is installed in/USR/local/bin, so there is no need to pass through the path, and it can be used immediately.First, execute "Image Snap -L" to make sure that the built -in camera is recognized.If you are a MacBook (Air/Pro), the built -in FaceTime HD Camera device number should be displayed.
$ brew install imagesnap
If the ImageSnap command is accessed to the first camera device running from Terminal, the dialog "I am trying to access the camera from" terminal "" will be displayed.This is because MacOS Mojave has begun to find user permission to access cameras and microphones as part of security/privacy enhancement.
Here, pressing the "OK" button is allowed, and Terminal is added to the "Camera" item in the "Privacy" tab of the system environment setting "Security and Privacy" panel.If you need to cancel later, execute the following command line from Terminal.This revokes permission to access the camera device from Terminal.
$ tccutil reset Camera
The imagesnap command is performed with the camera when executed without an argument, and saves it as "Snapshot.jpg".The only supported output format is JPEG, and the resolution depends on the camera.In other words, if you execute only "ImageSnap", a 1280 x 720 pixel "Snapshot.jpg" will be generated in the current directory.
However, initialization of the camera seems to require some time, and a black JPEG is generated in the default state.To avoid this, you can delay shooting with the "-w" option (unit is second, decimal point).When I tried it, it became dim from around 0.2 seconds (-w 0.2), and after 0.7 seconds (-w 0.7), I can shoot with a reasonable brightness.If you specify 1 second (-w 1), it will be certain.Once you check, you do not need to display the device name, so stop the output with the "-Q" option.
$ imagesnap -q -w 1
Now you can take photos at any timing from Terminal, but of course this is not a practical use.You can incorporate it into a shell script or Apple Script, run it regularly with a cron or Launchd, or use it as much as a CUI, but you need another device.
The "-T" option is effective for the application for photography at regular intervals.Like the "-w" option, the interval can be specified in seconds, and it adds a time stamp to the specified file name, which is useful when organizing photos later.
I'm not happy to take my face going to the Mac, so I thought about specific applications, but if you think about using a time -lapse movie material or making your own video, there are many things.The image quality of FaceTime HD Camera is not good for flattering, but Mac (CUI) has the possibility that a smartphone or a digital camera "turn with a script".The rest depends on the user's skill, the idea.