Skip to content

Commit d366010

Browse files
committed
Create timelapse directory and run stream-webrtc as lava user
v4l2-mpp changes (b28cf38 to 6979ef9): - Fix umask to be 0022 for proper file permissions - Send error back for failed methods in stream-snap-mqtt - Remove timelapse if no frames were generated - Improve state transition for stream-snap-mqtt - Add RTSP streaming support based on live555 - Refactor HTML WebRTC implementation - Improve build dependency management with make deps Create /userdata/.tmp_timelapse directory with proper permissions for timelapse files Run stream-webrtc as lava user instead of root
1 parent cba18fa commit d366010

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

overlays/camera-v4l2-mpp/root/etc/init.d/S99v4l2-mpp-mipi

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
[ ! -e /oem/.camera-native ] || exit 0
44

5+
# Create temporary directory for timelapse files
6+
umask 0022
7+
mkdir -p /userdata/.tmp_timelapse
8+
chown -R lava:lava /userdata/.tmp_timelapse
9+
510
CMD_CAPTURE=/usr/local/bin/capture-mipi-mpp
611
CMD_CAPTURE_ARGS="--device /dev/video11 --format nv12 --jpeg-quality 7 --jpeg-sock /tmp/capture-mipi-jpeg.sock --mjpeg-sock /tmp/capture-mipi-mjpeg.sock --h264-sock /tmp/capture-mipi-h264.sock"
712

@@ -11,6 +16,7 @@ CMD_WEBRTC_ARGS="--h264-sock /tmp/capture-mipi-h264.sock --webrtc-sock /tmp/capt
1116
CMD_HTTP=/usr/local/bin/stream-http.py
1217
CMD_HTTP_ARGS="--jpeg-sock /tmp/capture-mipi-jpeg.sock --mjpeg-sock /tmp/capture-mipi-mjpeg.sock --h264-sock /tmp/capture-mipi-h264.sock --webrtc-sock /tmp/capture-mipi-webrtc.sock --bind 127.0.0.1"
1318

19+
# Differently to Snapmaker, run as user lava, instead of the root user
1420
CMD_SNAP_MQTT=/usr/local/bin/stream-snap-mqtt.py
1521
CMD_SNAP_MQTT_ARGS="--jpeg-sock /tmp/capture-mipi-jpeg.sock --publish-dir /home/lava/printer_data/camera"
1622

@@ -25,7 +31,7 @@ start() {
2531
echo "OK"
2632

2733
printf "Starting stream-webrtc: "
28-
start-stop-daemon -S -b -q -m -p /var/run/stream-mipi-webrtc.pid -x $CMD_WEBRTC -- $CMD_WEBRTC_ARGS
34+
start-stop-daemon -S -b -q -m -p /var/run/stream-mipi-webrtc.pid -c lava -x $CMD_WEBRTC -- $CMD_WEBRTC_ARGS
2935
echo "OK"
3036

3137
printf "Starting stream-http: "

overlays/camera-v4l2-mpp/root/etc/init.d/S99v4l2-mpp-usb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ start() {
2222
echo "OK"
2323

2424
printf "Starting stream-webrtc: "
25-
start-stop-daemon -S -b -q -m -p /var/run/stream-usb-webrtc.pid -x $CMD_WEBRTC -- $CMD_WEBRTC_ARGS
25+
start-stop-daemon -S -b -q -m -p /var/run/stream-usb-webrtc.pid -c lava -x $CMD_WEBRTC -- $CMD_WEBRTC_ARGS
2626
echo "OK"
2727

2828
printf "Starting stream-http: "

overlays/camera-v4l2-mpp/scripts/01-v4l2-mpp.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,11 @@ TARGET_DIR="$ROOT_DIR/tmp/v4l2-mpp"
1313

1414
if [[ ! -d "$TARGET_DIR" ]]; then
1515
git clone https://github.com/paxx12/v4l2-mpp.git "$TARGET_DIR" --recursive
16-
git -C "$TARGET_DIR" checkout b28cf38c484e281e0b234a06aac2a7a9e524d710
16+
git -C "$TARGET_DIR" checkout bc2582be0ec0b4014b35f2579b93e6c18e399cce
1717
fi
1818

19-
echo ">> Compiling MPP library..."
20-
"$TARGET_DIR/deps/compile_mpp.sh"
21-
22-
echo ">> Compiling libdatachannel library..."
23-
"$TARGET_DIR/deps/compile_libdatachannel.sh"
19+
echo ">> Compiling dependencies..."
20+
make -C "$TARGET_DIR" deps
2421

2522
echo ">> Compiling v4l2-mpp applications..."
2623
make -C "$TARGET_DIR" install DESTDIR="$1"

0 commit comments

Comments
 (0)