Appunti su Raspicam

Specchio

raspivid -o /dev/null -hf -t 0

Streaming mjpg

sudo apt-get update
sudo apt-get install python3-picamera

Save this source in /home/pi directory:

wget https://www.tanzolab.it/www/raspicam/stream.py

launch it

python3 stream.py

and open this url on a browser

http://raspberrypi.local:8001/stream.mjpg

Execute stream.py as daemon

Create this file:

sudo nano /lib/systemd/system/stream.service

with this content:

[Unit]
Description=stream.py
After=systemd-user-sessions.service

[Service]
ExecStart=python3 stream.py
Restart=on-abort
User=pi
WorkingDirectory=/home/pi

[Install]
WantedBy=multi-user.target

save and launch the service:

sudo systemctl daemon-reload
sudo systemctl enable stream.service 
sudo systemctl start stream.service 

Doc librerie

Links