How do I get VLC to play nice to stream on boot?

I've tried running it on rc.local script, I've tried using a service and systemd including After=network.target and so forth so it only runs after we acquire our IP.

I get a variety of errors, sometimes it doesn't find the stdin input, other times it can't connect to the camera, sometimes I get a socket bind error. I solved most of these with the After= and then just did a list all and added everything that looked like it might help. I now narrowed it down to these "errors"

Nov 19 19:31:10 raspberry camera.sh[1229]: [6fd00ea0] lua art finder debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/03_lastfm.luac
Nov 19 19:31:10 raspberry camera.sh[1229]: [6fd00ea0] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
Nov 19 19:31:10 raspberry camera.sh[1229]: [6fd00ea0] core art finder debug: no art finder modules matched
Nov 19 19:31:10 raspberry camera.sh[1229]: [0052a230] core playlist debug: art not found for stdin
Nov 19 19:31:10 raspberry camera.sh[1229]: [6fc004d8] lua art finder debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/02_frenchtv.luac
Nov 19 19:31:10 raspberry camera.sh[1229]: [6fc004d8] lua art finder debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/03_lastfm.luac
Nov 19 19:31:11 raspberry camera.sh[1229]: [6fc004d8] lua art finder debug: skipping script (unmatched scope) /usr/lib/vlc/lua/meta/art/03_lastfm.luac
Nov 19 19:31:11 raspberry camera.sh[1229]: [6fc004d8] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
Nov 19 19:31:11 raspberry camera.sh[1229]: [6fc004d8] core art finder debug: no art finder modules matched
Nov 19 19:31:11 raspberry camera.sh[1229]: [0049f8f8] core libvlc debug: art not found for stdin

It always works if I disable/re-enable it after I login and rerun it.

My Systemd Service:

[Unit]
Description=raspistream
After=network.target
After=network-online.target
After=sockets.target
After=getty.target
After=graphical.target
After=sound.target
After=sysinit.target

[Service]
User=pi
ExecStart=/home/pi/Desktop/camera.sh

[Install]
WantedBy=default.target

My camera.sh script:

raspivid -o - -t 0 -w 800 -h 600 -fps 30 | cvlc -vvv --noaudio --no-sout-audio stream:///dev/stdin --sout '#standard{access=http, mux=ts, dst=:8554}' :demux=h264

The power keeps knocking it offline, and I don't want to have to login to restart it.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.