Welcome to USB Microphone Camera repository
1.1 Camera test tutorial
Part 1-Open the camera service of Raspberry Pi
1. If you use Raspberry Pi official system image, you need to open the camera service. Input sudo raspi-config command to enter following interface.
2. Choose fifth option [Interfacing Options] and click [Enter] key to enter next interface.

3. ChoOse [Camera] to enable camera.
4. Finally, we need to reboot Raspberry Pi.
Input sudo reboot command.
Part 2-- Testing camera
1. User must ensure that the camera is properly inserted into the Raspberry Pi board before supplying power to the Raspberry Pi board.
2. There are two kinds of commands that the Raspberry Pi terminal can use to detect external camera devices: ls/dev/video*. (In some cases, you may be able to use the camera without seeing video0 service)
After we input following command, we can detect camera service.
As shown below.

3. Input following command to install mplayer player.
sudo apt-get install mplayer -y
Wait patiently, after the installation is complete, you can see the interface shown below.
4. Input following command to install fswebcam video software.
sudo apt-get install fswebcam -y
Input following command to view USB camera picture.
sudo mplayer tv://

5. After confirming the screen, you need to exit through “ctrl+c” before proceeding to the next operation.
If you run mplayer and use the fswebcam command at the same time, the system will prompt an error that the camera is busy. As shown below.

6. Input following command to generate a real-time photo taken by the current camera in the /home/pi directory
fswebcam -d /dev/video0 --no-banner -r 320x240 -S 10 /home/pi/image.jpg
Parameter explanation:
-d -- configure which camera device to use
--no-banner --- There is no watermark in the photos taken. If this parameter is not used, the system may prompt a wrong font
-r -- Size of picture
-S -- Visibility, the range is from 1 to 10. If this parameter is not set or this parameter is set to 0, the photo will be black.
/home/pi/image.jpg -- Save the image path (if you do not add the path, picture will be saved in the current directory /home/pi/ by default ).
Part 3-- Recording test
Enter the sudo apt install audacity command on the terminal to install the recording software, and then enter audacity to open this software.
sudo apt install audacity
audacity

Perform recording playback test in the recording software.