Update service
This commit is contained in:
parent
6b9d957641
commit
2be35c8793
16
README.md
16
README.md
@ -53,6 +53,22 @@ sudo make install
|
|||||||
There are three modes of operation implemented offering different
|
There are three modes of operation implemented offering different
|
||||||
compatibility to performance.
|
compatibility to performance.
|
||||||
|
|
||||||
|
### Use a preconfigured systemd services
|
||||||
|
|
||||||
|
The simplest is to use preconfigured `service/camera-streamer*.service`.
|
||||||
|
Those can be used as an example, and can be configured to fine tune parameters.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
systemctl enable $PWD/service/camera-streamer-arducam-16MP.service
|
||||||
|
systemctl start camera-streamer-arducam-16MP
|
||||||
|
```
|
||||||
|
|
||||||
|
If everything was OK, there will be web-server at `http://<IP>:8080/`.
|
||||||
|
|
||||||
|
Error messages can be read `journalctl -xef -u camera-streamer-arducam-16MP`.
|
||||||
|
|
||||||
### High-compatibility via `libcamera`
|
### High-compatibility via `libcamera`
|
||||||
|
|
||||||
This script uses `libcamera` to access camera and provide
|
This script uses `libcamera` to access camera and provide
|
||||||
|
@ -3,21 +3,22 @@ Description=camera-streamer web camera
|
|||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=nobody
|
|
||||||
Group=nogroup
|
|
||||||
SupplementaryGroups=video i2c
|
|
||||||
ExecStart=/usr/local/bin/camera-streamer \
|
ExecStart=/usr/local/bin/camera-streamer \
|
||||||
-camera-path=/base/soc/i2c0mux/i2c@1/imx519@1a \
|
-camera-path=/base/soc/i2c0mux/i2c@1/imx519@1a \
|
||||||
-camera-type=libcamera \
|
-camera-type=libcamera \
|
||||||
-camera-format=YUYV \
|
-camera-format=YUYV \
|
||||||
-camera-width=2328 -camera-height=1748 \
|
-camera-width=2328 -camera-height=1748 \
|
||||||
-camera-high_res_factor=1.5 \
|
-camera-fps=30 \
|
||||||
-camera-fps=30
|
-camera-nbufs=2 \ # use two memory buffers to optimise usage
|
||||||
# set auto-focus for IMX519
|
-camera-high_res_factor=1.5 \ # the high-res is 1552x1165
|
||||||
ExecStartPost=-/bin/bash -c 'sleep 3s; /usr/sbin/i2ctransfer -y 11 w4@0x0c 0x0 0x85 0x00 0x00'
|
-camera-low_res_factor=3.0 \ # the low-res is 776x582
|
||||||
|
-camera-options=brightness=0.1 # bump brightness slightly
|
||||||
|
|
||||||
|
User=nobody
|
||||||
|
Group=nogroup
|
||||||
|
SupplementaryGroups=video i2c
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
|
|
||||||
Nice=10
|
Nice=10
|
||||||
IOSchedulingClass=idle
|
IOSchedulingClass=idle
|
||||||
IOSchedulingPriority=7
|
IOSchedulingPriority=7
|
32
service/camera-streamer-arducam-64MP.service
Normal file
32
service/camera-streamer-arducam-64MP.service
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=camera-streamer web camera
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStartPre=-/usr/bin/v4l2-ctl -d /dev/v4l-subdev1 -c focus_absolute=2200 # set fixed-focus
|
||||||
|
ExecStart=/usr/local/bin/camera-streamer \
|
||||||
|
-camera-path=/base/soc/i2c0mux/i2c@1/arducam_64mp@1a \
|
||||||
|
-camera-type=libcamera \
|
||||||
|
-camera-format=YUYV \
|
||||||
|
-camera-width=2328 -camera-height=1748 \
|
||||||
|
-camera-fps=30 \
|
||||||
|
-camera-nbufs=2 \ # use two memory buffers to optimise usage
|
||||||
|
-camera-high_res_factor=1.5 \ # the high-res is 1552x1165
|
||||||
|
-camera-low_res_factor=3.0 \ # the low-res is 776x582
|
||||||
|
-camera-options=brightness=0.1 \ # bump brightness slightly
|
||||||
|
-camera-auto-focus=0 # disable auto-focus
|
||||||
|
|
||||||
|
User=nobody
|
||||||
|
Group=nogroup
|
||||||
|
SupplementaryGroups=video i2c
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10
|
||||||
|
Nice=10
|
||||||
|
IOSchedulingClass=idle
|
||||||
|
IOSchedulingPriority=7
|
||||||
|
CPUWeight=20
|
||||||
|
AllowedCPUs=1-2
|
||||||
|
MemoryMax=250M
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
28
service/camera-streamer-usb-cam.service
Normal file
28
service/camera-streamer-usb-cam.service
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=camera-streamer web camera
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/local/bin/camera-streamer \
|
||||||
|
-camera-path=/dev/video0 \
|
||||||
|
-camera-format=JPEG \
|
||||||
|
-camera-width=1920 -camera-height=1080 \
|
||||||
|
-camera-fps=30 \
|
||||||
|
-camera-nbufs=2 \ # use two memory buffers to optimise usage
|
||||||
|
-camera-high_res_factor=1.0 \ # the high-res is 1920x1080
|
||||||
|
-camera-low_res_factor=2.0 # the low-res is 960x540
|
||||||
|
|
||||||
|
User=nobody
|
||||||
|
Group=nogroup
|
||||||
|
SupplementaryGroups=video i2c
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10
|
||||||
|
Nice=10
|
||||||
|
IOSchedulingClass=idle
|
||||||
|
IOSchedulingPriority=7
|
||||||
|
CPUWeight=20
|
||||||
|
AllowedCPUs=1-2
|
||||||
|
MemoryMax=250M
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
x
Reference in New Issue
Block a user