Raspberry Pi Night Vision Camera use tutorial for Raspberry Pi 3B+
1.You need to connect camera to Raspberry Pi board.
2.You must to install a new operating system before use camera, which can can identify if the camera module is connected. The simplest method is download Raspbain system from Raspberry Pi website, and install it to new SD card.
Regardless of the version of the Raspbian system you are using, I recommend that you update the system with the following command:
sudo apt-get update
sudo apt-get upgrade
3.Enable camera options
3.1)You need to input: sudo raspi-config to enter the following interface:
3.2)You need to choose “Interfacing Options”, press the “Enter” key of your keyboard to enter the configuration.
3.3)You need to choose “P1 Camera”, press the “Enter” key of your keyboard to start camera functions.
3.4) You need to choose “Yes”.
After the above steps, the camera function of Raspberry Pi has been turned on.
We recommend using method 1
Method 1:You can use Raspberry Pi official original camera by system command
raspistill -------This command is to get the static image
The picture below shows the parameter information about the command displayed directly by the command raspistill.
raspivid -------This command is to get the video information
Raspistill related commands:
1.After a delay of 1.1 seconds (in milliseconds), take a photo and name it image.jpg
raspistill -t 1000 -o image.jpg
2. Take a photo of custom size and frame rate
raspistill -t 1000 -o image.jpg -w 640 -h 480 -q 5
3. Set embossed style image effects
raspistill -t 1000 -o image.jpg -ifx emboss
4. Get a photo and send it to a standard output device (such as a monitor)
raspistill -t 1000 -o
Raspivid related commands:
1. Shoot a video: The default is video length is 5s, resolution is 1920*1080, frame rate: 17
raspivid -o myvideo.h264
2. Take a video: resolution is 640*480, time is 10s
raspivid -o myvideo.h264 -t 10000 -w 640 -h 480
Note: raspivid outputs an uncompressed H.264 video stream. In order to allow our normal video player to play, you need to install the gpac package.
apt-get install -y gpac
Then use the MP4Box application in the gpac package to convert the H.264 format video stream to 10 frames per second MP4 format video.
MP4Box -fps 10 -add myvideo.h264 myvideo.mp4
Method 2: You can transfer the video which captured by the Raspberry Pi to the web page.
4.1) You need to log into Raspberry Pi system and give home folder permissions to copy drive folders to this directory. This operation can only be performed by root users.
4.2) You should input: #su
(This command to make you enter root user)
4.3) Then input your password of root permissions
4.4) You should input: #chmod 777 /home
(This command to give home folder permissions to RWX.)
4.5) You need to copy “master.zip” to home directory. As shown in the figure below.
4.6) You should input: #unzip master.zip
(This command to unzip mater.zip)
After complete unzip, you can see migp-streamer-master folder. As shown in the figure below.
4.7) Compiling this project requires cmake: perform the following command to install download.
(apt-get is a networked installation, so you need make Raspberry Pi successfully connect to the network.)
You should input:
#sudo apt-get install cmake
A prompt will appear when installing, you need to enter Y.
After completion, As shown in the figure below.
5. You need to install library
You should input: #sudo apt-get install libjpeg8-dev
After completion, As shown in the figure below.
You need to enter: /home/pi/mjpg-streamer-master/mjpg-streamer-experimental/
And you need to run the following command directly
#make clean all
You can wait for the compilation to complete, you can see the interface shown below.
7. Restart system
You need to input: reboot to reboot system
Plug in the camera and restart the system.
8. After rebooting, enter the system.
You need to enter the mjpg-streamer-experimental directory by command. And use the following command to start the Raspberry Pi Official Original Camera:
#./mjpg_streamer -i "./input_raspicam.so" -o "./output_http.so -w ./www"
(Note:Raspberry Pi special camera includes: Raspberry Pi night vision camera, Raspberry Pi official original camera, Raspberry pie wide-angle camera)
If you want to modify the resolution of the captured video,you need to input the following command:
#./mjpg_streamer -i "./input_raspicam.so -w 320 -h 240 -fps 10" -o "./output_http.so -w ./www"
Some cameras will report an error when executing this command. If they do not return to the command prompt and display "Starting Camera", it means success.
As shown in the figure below, the camera is successfully turned on:
9. Test results
View the image, open the browser on the PC side, you need to enter the following URL to see the static screenshot:
My URL is：http://192.168.0.112:8080/?action=snapshot
You should input the following URL to see the dynamic image: http://<RaspberryPi IP>:8080/?action=stream
My URL is：http://192.168.0.112:8080/?action=stream
PS: When using the RaspiCamera dedicated camera, the dynamic image screen will have a transmission delay, about 1.4 frames / sec. It is recommended to use static capture.
More Raspberry i Night Vision Camera Tutorial:
- Raspberry Pi Night Vision Camera Environmental preparation For Raspberry Pi 3B+
- Raspberry Pi Night Vision Camera Environmental preparation Raspberry Pi 4B
- Raspberry Pi Night Vision Camera Use tutorial For Raspberry Pi 3B+
- WinSCP file transfer between Raspberry Pi and windows
- Raspberry Pi Night Vision Camera Use tutorial Raspberry Pi 4B