forked from vfonov/simple_baby_monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
capture.service
37 lines (32 loc) · 1000 Bytes
/
capture.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[Unit]
Description=Camera capture service
Requires=janus.service
After=janus.service
StartLimitIntervalSec=1
StartLimitBurst=5
ConditionPathExists=/dev/video0
[Service]
Type=simple
Restart=always
RestartSec=1
User=pi
# 10 seconds delay
ExecStartPre=/bin/sleep 10
# start capturing video using Raspberry PI hardware acceleration for compression
ExecStart=gst-launch-1.0 \
-v v4l2src device=/dev/video0 ! \
video/x-raw,width=640,height=480,framerate=30/1 ! \
videorate ! videoconvert ! \
omxh264enc target-bitrate=240000 control-rate=variable ! \
h264parse ! \
rtph264pay config-interval=1 pt=96 ! \
udpsink host=127.0.0.1 port=8004 \
alsasrc device=plughw:1 ! \
audioresample quality=1 ! \
audio/x-raw,rate=16000,channels=1 ! \
opusenc bitrate=10000 ! \
rtpopuspay ! tee name=t \
t. ! queue ! udpsink host=127.0.0.1 port=8002 \
t. ! queue ! udpsink host=127.0.0.1 port=8001
[Install]
WantedBy=multi-user.target