We use systemd to manage services. That’s why I recommend this page to get started. Even though it looks kinda intimidating at first, this is just robust and rigorous. In the nutshell all you need to do:
- create a simple service file (for example, let it be raspicam.service) which contains something like this:
[Unit]
Description=raspivid
After=network.target
[Service]
ExecStart=/usr/bin/raspivid -n ....
[Install]
WantedBy=default.target
-
put it in /etc/systemd/system/
-
sudo systemctl daemon-reload
to let systemd know of this service -
sudo systemctl start raspivid
to test it out -
sudo systemctl enable raspivid
to enable on boot