This guide contains the command to automatically set up the mediamtx streaming server on your Raspberry Pi for the webcam upgrade project.
Before you run this command, please ensure:
- You have successfully flashed your SD card with Raspberry Pi OS.
- You are currently connected to your Raspberry Pi via an SSH terminal.
The first step of the script is to update the Raspberry Pi's operating system. Occasionally, during this process, the system may ask you a question in the terminal (e.g., what to do with an updated configuration file).
This is normal. If you see such a prompt, the safest and easiest choice is to accept the default option. You can usually do this by simply pressing the Enter key.
Copy the entire line below and paste it into your SSH terminal, then press Enter.
wget -O setup_camera.sh https://gist.githubusercontent.com/kldzj/b469a92a204ac7a7bac9fd5f0920c455/raw/01f565875ca1c02d7925a2069a3dd05cded43186/setup_camera.sh && sudo bash setup_camera.shThis single line performs two actions safely:
wget -O setup_camera.sh ...: This part securely downloads the installation script from the trusted source and saves it on your Raspberry Pi assetup_camera.sh.&& sudo bash setup_camera.sh: If the download was successful (&&), this part executes the script you just downloaded with the necessary administrator privileges (sudo) to install software and configure the service.
After you run the command:
- The script will first update your system.
- You will then be prompted to select your camera model from a list.
- The script will complete the rest of the installation automatically.
- Finally, your Raspberry Pi will reboot to ensure everything starts correctly.
After the reboot, your camera stream will be active and ready to be used!