Start Python script with gstreamer

Hello.

I have a Python code where I start a video capture using gstreamer. If I start my script like python3 video.py, it works ok.

Now I try to activate my script on system boot. I try to use systemctl but I faced some problems.

  1. Sometimes I have to run sudo service nvargus-daemon restart, because otherwise my code crashes.
  2. Sometimes my code just stop doing anything, however the service is active.

I created a service with these parameters:

[Unit]
Description=Dummy Service
After=multi-user.target
Conflicts=getty@tty1.service

[Service]
Type=simple
RestartSec=20
WatchdogSec=600
Restart=on-failure
User=user1
ExecStart=/usr/bin/python3 /home/user1/doorbell_bot/video2.py
StandardInput=tty-force

[Install]
WantedBy=multi-user.target

What should I do to make my code works properly and without mistakes? The problem is that I cannot just activate it via python3 video.py because it is a remote server and after logging out from ssh it will stop.

Thank you!

Hi,
We try the case of setting up rc.local to run a gstreamer pipeline. Please take a look at

Not exactly fit your usecase but you may give it a try.