Skip to content

Commit 0221016

Browse files
committed
Switch to using precompiled camera-streamer
Fetched from apt.octoprint.org
1 parent e6f79fe commit 0221016

9 files changed

Lines changed: 19 additions & 30 deletions

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ and provides the resulting image ready to flash. Checkout the [releases](https:/
99

1010
A bunch of simple update scripts are run via [CustoPiZer](https://github.com/OctoPrint/CustoPiZer):
1111

12-
* `01-update-octoprint`: Updates OctoPrint to the latest version
13-
* `02-update-boot`: Updates bootloader and kernel to the latest version
14-
* `03-update-libcamera-apps`: Updates the the libcamera apps to the latest version
12+
* `01-add-octoprint-apt-repo`: Adds `apt.octoprint.org` to the apt sources
13+
* `02-update-octoprint`: Updates OctoPrint to the latest version
14+
* `03-update-boot`: Updates bootloader and kernel to the latest version
1515
* `10-install-camera-streamer`: Installs the new [camera-streamer](https://github.com/ayufan/camera-streamer) based webcam stack, replacing mjpg-streamer and webcamd. The new stack supports libcamera based cameras like the RPi Cam v3 and newer Arducams, and is also more performant. See [the FAQ](https://faq.octoprint.org/camera-streamer-config) for more details.
1616
* `11-install-pb`: Installs a small script under `/usr/local/bin/pb` that allows to easily share stdin or a text file to paste.octoprint.org.
1717
* `80-install-user-fix`: Installs a compatibility layer to support renaming the `pi` user, if needed.

scripts/01-add-octoprint-apt-repo

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
set -x
2+
set -e
3+
4+
export LC_ALL=C
5+
6+
source /common.sh
7+
install_cleanup_trap
8+
9+
curl -s --compressed "https://apt.octoprint.org/octoprint.gpg.key" | gpg --dearmor > /etc/apt/trusted.gpg.d/octoprint.gpg
10+
curl -s --compressed -o /etc/apt/sources.list.d/octoprint-rpi.list "https://apt.octoprint.org/octoprint-bullseye-rpi.list"
11+
apt-get update

scripts/03-update-libcamera-apps

Lines changed: 0 additions & 9 deletions
This file was deleted.

scripts/10-install-camera-streamer

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,8 @@ export LC_ALL=C
66
source /common.sh
77
install_cleanup_trap
88

9-
[ -n "$CAMERA_STREAMER_ARCHIVE" ] || CAMERA_STREAMER_ARCHIVE="https://github.com/OctoPrint/camera-streamer-archive/releases/download/master-20230309133708/camera-streamer.zip"
10-
11-
# install dependencies
12-
apt-get install --yes libavformat-dev libavutil-dev libavcodec-dev libcamera-dev liblivemedia-dev v4l-utils pkg-config xxd build-essential cmake libssl-dev
13-
14-
# install camera-streamer
15-
curl -L -o /tmp/camera-streamer.zip "$CAMERA_STREAMER_ARCHIVE"
16-
unzip /tmp/camera-streamer.zip -d /tmp/camera-streamer
17-
rm /tmp/camera-streamer.zip
18-
19-
pushd /tmp/camera-streamer/camera-streamer
20-
make -j$(nproc)
21-
make install
22-
popd
23-
rm -rf /tmp/camera-streamer
9+
# install our precompiled camera-streamer from apt.octoprint.org
10+
apt-get install --yes camera-streamer libcamera-apps-lite
2411

2512
# enable camera auto-detection
2613
sed -i 's/^camera_auto_detect=0/camera_auto_detect=1/' /boot/config.txt

scripts/11-install-pb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export LC_ALL=C
66
source /common.sh
77
install_cleanup_trap
88

9-
# if input_raspi.so is there, we don't need to do anything
9+
# if pb is there, we don't need to do anything
1010
[ -f /usr/local/bin/pb ] && exit 0
1111

1212
cp /files/pb /usr/local/bin/pb

scripts/files/camera-streamer/camera-streamer-libcamera.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ StartLimitBurst=10
99
EnvironmentFile=/boot/camera-streamer/libcamera.conf
1010
ExecCondition=/bin/sh -c "/usr/bin/libcamera-hello --list-cameras | grep -o '/base/soc/[^)]*'"
1111
ExecCondition=/bin/sh -c "! ss -ltn src :$PORT | grep -q LISTEN"
12-
ExecStart=/bin/sh -c "exec /usr/local/bin/camera-streamer \
12+
ExecStart=/bin/sh -c "exec /usr/bin/camera-streamer \
1313
-http-port=${PORT} \
1414
-camera-type=libcamera \
1515
-camera-path=$(/usr/bin/libcamera-hello --list-cameras | grep -o '/base/soc/[^)]*' | head -n1) \

scripts/files/camera-streamer/camera-streamer-usb@.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ StartLimitBurst=10
1212
EnvironmentFile=/boot/camera-streamer/usb-%i.conf
1313
ExecCondition=/bin/sh -c "[ -e $DEVICE ]"
1414
ExecCondition=/bin/sh -c "! ss -ltn src :$PORT | grep -q LISTEN"
15-
ExecStart=/bin/sh -c "exec /usr/local/bin/camera-streamer \
15+
ExecStart=/bin/sh -c "exec /usr/bin/camera-streamer \
1616
-http-port=${PORT} \
1717
-camera-type=v4l2 \
1818
-camera-path=$(ls -b $DEVICE | head -n1) \

0 commit comments

Comments
 (0)