Building a raspberry pi streaming cam
This is how my setup looks like:
as webcam I use a Waveshare 10300 RPi Camera (E)
(bought it here, unpaid advertisment)
Install raspberry pi image
Download the images from the raspberry pi website
copy it to your sd card.
on the webpage they recomment to install the rpi-manager via
sudo apt install rpi-imager, but for me it wasn’t working because of dependency problems.
So I installed it the classic way:
unzip -p YOUR_RASPBIAN_IMAGE.zip | sudo dd of=/dev/YOURDEVICE bs=4M conv=fsync
lsblk -p which is your SD card, so you are not deleting your harddrive.
Maybe plug it in and out to be sure.
For more information about this, go to the offical (Linux) installation page.
Activate your (already pluged in) Camera
Go to settings -> interfaces -> cam -> and switch it on Make now a restart, and it should be activated
Install and set-up MOTION
I used for streaming the service called
Install it via
sudo apt-get install motion -y
As I never used motion before, I followed this real great raspberry pi cam tutorial (German). The only thing I changed was the
framerate to 100 instead of 10.
edit the motion.conf file:
sudo nano /etc/motion/motion.conf
turn the daemon on:
allow others to watch the stream in the network:
set the target for your stream, I used the same as the blog above recommend me:
I set the
width 1280 and
height 720 and
I uploaded my complete
motion.conf to my Github repo
Then, set the demon to yes:
sudo nano /etc/default/motion
now set the rights of the folder correct:
mkdir /home/pi/Monitor sudo chgrp motion /home/pi/Monitor chmod g+rwx /home/pi/Monitor
you can start it now with
Use your local IP to stream to your browser:
find out over
ifconfig what your local IP is.
I can reach in my wifi then the stream under: http://184.108.40.206:8081
Remember: the port 8081 was defined in the point above
start motion everytime you start your raspberry pi
to have it always running I used a cronjob:
$ crontab -e
and in the cronjob I save:
@reboot sudo motion
that made it working for me!