From ad41a99d10f95acb20bae0326727d94501cc3240 Mon Sep 17 00:00:00 2001 From: legop3 Date: Mon, 24 Nov 2025 13:51:54 -0500 Subject: [PATCH] room camera service for server --- server/systemd/room-camera.service | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 server/systemd/room-camera.service diff --git a/server/systemd/room-camera.service b/server/systemd/room-camera.service new file mode 100644 index 00000000..95b86443 --- /dev/null +++ b/server/systemd/room-camera.service @@ -0,0 +1,24 @@ +[Unit] +Description=Room camera SRT publisher (ensures mic capture unmuted) +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +ExecStartPre=/usr/bin/amixer -c 0 sset 'Mic Capture Switch' cap +ExecStartPre=/usr/bin/amixer -c 0 sset 'Mic Capture Volume' 100% +ExecStart=/usr/bin/ffmpeg \ + -fflags nobuffer -thread_queue_size 256 -f v4l2 -input_format h264 -i /dev/video2 \ + -fflags nobuffer -thread_queue_size 256 -f alsa -ar 16000 -ac 2 -i hw:0,0 \ + -map 0:v:0 -map 1:a:0 \ + -c:v copy \ + -c:a libopus -b:a 64k -ar 16000 -ac 1 \ + -flush_packets 1 -f mpegts \ + srt://192.168.0.86:9000?streamid=#!::r=room/carpet,m=publish&latency=10&mode=caller&transtype=live&pkt_size=1316 +Restart=always +RestartSec=2 +User=root +Group=root + +[Install] +WantedBy=multi-user.target