@@ -6,36 +6,38 @@ export LC_ALL=C
66source /common.sh
77install_cleanup_trap
88
9+ ### --- install the new stuff -----------------------------------------------
10+
911# install our precompiled camera-streamer from apt.octoprint.org
10- apt-get install --yes camera-streamer libcamera-apps-lite
12+ apt-get install --yes camera-streamer libcamera-apps-lite v4l-utils
13+
14+ # install units, configs & helpers
15+ pushd /tmp
16+ git clone https://github.com/OctoPrint/camera-streamer-stack.git
17+ pushd camera-streamer-stack
18+ make install
19+ popd
20+ rm -rf camera-streamer-stack
21+ popd
22+
23+ # put configs on /boot on OctoPi
24+ mv /etc/camera-streamer.conf.d /boot/camera-streamer
25+ ln -s /boot/camera-streamer /etc/camera-streamer.conf.d
26+
27+ # only run stack if mjpeg is selected as streamer
28+ for unit in camera-streamer camera-streamer-usb@ camera-streamer-libcamera; do
29+ mkdir /etc/systemd/system/$unit.service.d/ && \
30+ echo -e "[Unit]\nConditionPathExists=/etc/octopi_streamer/mjpeg" > /etc/systemd/system/$unit.service.d/override.conf
31+ done
1132
1233# enable camera auto-detection
1334sed -i 's/^camera_auto_detect=0/camera_auto_detect=1/' /boot/config.txt
1435
15- # install default configs
16- mkdir -p /boot/camera-streamer
17- cp /files/camera-streamer/libcamera.conf /boot/camera-streamer/libcamera.conf
18- cp /files/camera-streamer/usb-default.conf /boot/camera-streamer/usb-default.conf
19-
20- # install services
21- cp /files/camera-streamer/camera-streamer-control /usr/local/bin/camera-streamer-control
22- chmod +x /usr/local/bin/camera-streamer-control
23-
24- cp /files/camera-streamer/camera-streamer*.service /etc/systemd/system/
25- chmod -x /etc/systemd/system/camera-streamer*.service
26-
2736# Only enable the camera-streamer service, it will start the others as configured
2837systemctl enable camera-streamer.service
2938
30- # install helper scripts
31- cp /files/camera-streamer/add-usb-camera /usr/local/bin/add-usb-camera
32- cp /files/camera-streamer/remove-usb-camera /usr/local/bin/remove-usb-camera
33- cp /files/camera-streamer/list-usb-cameras /usr/local/bin/list-usb-cameras
34- chmod +x /usr/local/bin/add-usb-camera
35- chmod +x /usr/local/bin/remove-usb-camera
36- chmod +x /usr/local/bin/list-usb-cameras
39+ ### --- clean up the old stuff ------------------------------------------------
3740
38- # clean up the old stuff
3941cat > /boot/octopi.txt <<EOF
4042### IMPORTANT: Looking for the camera settings? Those are now located
4143### in the camera-streamer directory! libcamera.conf to configure the Raspberry Pi
0 commit comments