The .sh file:
Code: Select all
echo "Starting camera service...";
cvlc v4l2:// :input-slave=alsa:// :v4l2-standard=1 :v4l2-dev=/dev/video0 :live-caching=1000 :sout="#transcode{vcodec=theo, vb=1000, scale=0.5, fps=5, acodec=vorb, ab=128, channels=1$, samplerate=44100}:duplicate{dst=gather:std{dst=:8080/stream.ogg,access=http}}}"
Code: Select all
[Unit]
Description=Security camera service.
[Service]
Type=simple
User=username
ExecStart=/bin/bash /location/of/securecamera.sh
[Install]
WantedBy=multi-user.target
Code: Select all
9月 07 15:54:29 verite systemd[1]: Started Security camera service..
9月 07 15:54:29 verite bash[8925]: Starting camera service...
9月 07 15:54:29 verite bash[8925]: [0000561b4b1839a0] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
9月 07 15:54:29 verite bash[8925]: [0000561b4b22e1f0] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
9月 07 15:54:29 verite bash[8925]: [0000561b4b22e1f0] main interface error: no suitable interface module
9月 07 15:54:29 verite bash[8925]: [0000561b4b0af580] main libvlc error: interface "dbus,none" initialization failed
9月 07 15:54:29 verite bash[8925]: [0000561b4b22da70] main interface error: no suitable interface module
9月 07 15:54:29 verite bash[8925]: [0000561b4b0af580] main libvlc error: interface "globalhotkeys,none" initialization failed
9月 07 15:54:29 verite bash[8925]: [0000561b4b22da70] dummy interface: using the dummy interface module...
9月 07 15:54:29 verite bash[8925]: [00007f96384ca130] mux_ogg mux: Open
How could I start vlc as a service and streaming video with valid sound?