Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 2468

Raspberry Pi OS • Pi camera runs in terminal but not in service

$
0
0
Hi,

I am trying to configure my Pi camera to act as webcam.
I added this service:
pi@pi:~ $ cat /lib/systemd/system/picamera.service
[Unit]
Description=Run Pi Camera as Webcam
After=network.target

[Service]
Type=simple
Restart=on-failure
ExecStart=rpicam-vid -n --width 1280 --height 720 -b 1000000 --framerate 15 -t 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.178.20 port=9000

[Install]
WantedBy=default.target
The service always fails.
Jan 05 00:48:56 pi systemd[1]: picamera.service: Scheduled restart job, restart counter is at 5.
Jan 05 00:48:56 pi systemd[1]: Stopped picamera.service - Run Pi Camera as Webcam.
Jan 05 00:48:56 pi systemd[1]: picamera.service: Start request repeated too quickly.
Jan 05 00:48:56 pi systemd[1]: picamera.service: Failed with result 'exit-code'.
Jan 05 00:48:56 pi systemd[1]: Failed to start picamera.service - Run Pi Camera as Webcam.
the following command runs ok after the system boots:
rpicam-vid -n --width 1280 --height 720 -b 1000000 --framerate 15 -t 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.178.20 port=9000
does anyone know why the command runs on my terminal but doesn't run as service?

Statistics: Posted by akhodeir — Sat Jan 04, 2025 11:58 pm



Viewing all articles
Browse latest Browse all 2468

Trending Articles