software:zoneminder:picamera
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
software:zoneminder:picamera [2021/06/06 01:34] – rodolico | software:zoneminder:picamera [2025/04/15 15:53] (current) – rodolico | ||
---|---|---|---|
Line 7: | Line 7: | ||
Anyway, no GUI needed, so I did the Raspberry Pi OS Lite (https:// | Anyway, no GUI needed, so I did the Raspberry Pi OS Lite (https:// | ||
+ | ===== Get raspbian image onto SD ===== | ||
+ | |||
+ | - Download the Lite version of Raspbian from [[https:// | ||
+ | - write the downloaded image to the micro-sd (do not uncompress) | ||
+ | - mount /boot from SD onto /mnt | ||
+ | <code bash> | ||
+ | touch / | ||
+ | # only do the following if you need wifi. Change country code, ssid and psk for your system | ||
+ | # see [[https:// | ||
+ | cat <<EOF >/ | ||
+ | ctrl_interface=DIR=/ | ||
+ | update_config=1 | ||
+ | country=< | ||
+ | |||
+ | network={ | ||
+ | | ||
+ | | ||
+ | } | ||
+ | EOF | ||
+ | </ | ||
+ | |||
+ | Insert SD into your Pi and boot up. | ||
===== Configure Raspberry Pi ===== | ===== Configure Raspberry Pi ===== | ||
- | - Enable wlan by adding the following to / | + | Enable wlan by adding the following to / |
+ | <file> | ||
+ | country=US | ||
network={ | network={ | ||
| | ||
| | ||
- | }</ | + | } |
- | - Enable camera interface< | + | </file> |
- | raspi-config | + | |
- | # go to Interface, and enable camera | + | |
- | </code> | + | |
- | - Verify camera works< | + | |
- | raspistill -v -o test.jpg | + | |
- | </ | + | |
- | + | ||
- | ===== Install v4l2rtspserver on camera ===== | + | |
+ | Now, do the install | ||
<code bash> | <code bash> | ||
- | # get pre-req's | + | # Set up Camera |
- | apt -y install | + | raspi-config # go to Interface, and enable camera |
+ | reboot | ||
+ | ls -lh / | ||
+ | raspistill -v -o test.jpg # Verify camera works | ||
+ | # Remove Swap File | ||
+ | sudo systemctl stop dphys-swapfile.service | ||
+ | sudo systemctl disable dphys-swapfile.service | ||
+ | sudo systemctl mask dphys-swapfile.service | ||
+ | sudo rm /var/swap | ||
+ | # add zram for swap | ||
+ | sudo apt-get install zram-tools | ||
+ | sed -i 's\.*ALLOCATION=.*\ALLOCATION=100\g' | ||
+ | sudo systemctl enable zramswap | ||
+ | sudo systemctl restart zramswap | ||
+ | # Set up ntp | ||
+ | sudo apt-get install | ||
+ | sudo timedatectl set-timezone America/ | ||
+ | # add base packages needed | ||
+ | sudo apt install \ | ||
+ | liblivemedia-dev | ||
+ | # get and build v4l2... | ||
git clone https:// | git clone https:// | ||
cd v4l2rtspserver | cd v4l2rtspserver | ||
Line 32: | Line 69: | ||
make | make | ||
sudo make install | sudo make install | ||
- | </ | + | # do the install |
- | + | sudo gdebi v4l2rtspserver-0.2.0-6-g3542b6f-Linux-armv6l.deb | |
- | <code conf v4l2rtspserver.service> | + | # create systemd module |
+ | cat <<EOF >/ | ||
# systemd configuration for v4l2rtspserver | # systemd configuration for v4l2rtspserver | ||
# / | # / | ||
+ | |||
[Unit] | [Unit] | ||
Description=v4l2rtspserver rtsp streaming server | Description=v4l2rtspserver rtsp streaming server | ||
After=network.target | After=network.target | ||
+ | |||
[Service] | [Service] | ||
# | # | ||
ExecStartPre=/ | ExecStartPre=/ | ||
- | ExecStart=/ | + | ExecStart=/ |
# | # | ||
Type=simple | Type=simple | ||
Line 51: | Line 89: | ||
Group=video | Group=video | ||
Restart=always | Restart=always | ||
+ | |||
[Install] | [Install] | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
+ | EOF | ||
+ | |||
+ | # enable the service | ||
+ | sudo systemctl enable --now v4l2rtspserver.service | ||
</ | </ | ||
- | <code bash> | + | At this point, you should be able to get an rtsp by pointing vlc to [[rtsp://{pi zero ip}: |
- | systemctl start v4l2rtspserver | + | |
- | </code> | + | |
===== Zoneminder Configuration ===== | ===== Zoneminder Configuration ===== |
software/zoneminder/picamera.txt · Last modified: 2025/04/15 15:53 by rodolico