The RPi camera
sudo raspi-config / Interface Options / Legacy Camera
- enabling the camera in the Raspberry Pi terminal.
Type these commands into the CMD:
ssh [username]@[ip_of_the_pi]
+ enter your password.sudo nano /boot/config.txt
- uncomment in this file by deleting the#
sign:#hdmi_force_hotplug=1
#hdmi_group=1
#hdmi_mode=1
(change it tohdmi_mode=16
)dtoverlay=vc4-fkms-v3d
- comment this line by adding the#
sign.- Save and exit the file.
sudo reboot
When you are back in the VNC, type raspistill
into the terminal. If there is no error, it means that you have successfully installed the camera module. It should show you the "help" list of this command.

Using the camera from the Raspberry Pi terminal
mkdir camera
(creating a "camera" folder)
Images
raspistill -o camera/img.jpg
(o - output) - taking a picture
raspistill
arguments (we add them after the path):
rot 180
- rotating the image by 180 degrees (you could have the camera upside down).
-w 1280 -h 720
- setting a lower resolution to save memory.
Videos
raspivid -o camera/video.h264 -rot 180 -w 720 -h 480
(.h264
is a video format).
raspivid
, by default, will record for 5 seconds. To change that time, we can use this argument: -t 7000
(the time is in milliseconds).