adafruit / pi_video_looper

Application to turn your Raspberry Pi into a dedicated looping video playback device, good for art installations, information displays, or just playing cat videos all day.
GNU General Public License v2.0
451 stars 239 forks source link

using systemd instead of supervisor #149

Open christiansievers opened 2 years ago

christiansievers commented 2 years ago

I had a go at the idea to run it via systemd, using the branch you started. It appears the devil is in the details of the video_looper.service file. I noticed two things.

# systemd configuration to run video looper at boot and
# ensure it runs continuously.

[Unit]
Description=Adafruit Raspberry Pi Video Looper
After=getty.target
# after login prompt appears

[Service]
TimeoutStartSec=0
Type=simple
ExecStart=/usr/bin/omxplayer -r --loop -o both "/home/pi/testvideo.mp4"
#ExecStart=/usr/bin/python3 -u -m Adafruit_Video_Looper.video_looper 
Restart=always
RestartSec=3
User=root

[Install]
WantedBy=multi-user.target

So the error lies with ExecStart=sudo /usr/bin/python3 -u -m Adafruit_Video_Looper.video_looper. Probably the 2nd half of that line. The examples I found don't use python packages but single python script files. I don't know how to link to the package. /usr/local/lib/python3.7/dist-packages/Adafruit_Video_Looper.video_looper doesn't seem to work. And it may install somewhere else on another system.

Just sharing my notes with you, no rush...

tofuSCHNITZEL commented 2 years ago

just a heads up. this is already part of the dev branch (together with the pip install change which solves the module not found error) still needs some testing though

tofuSCHNITZEL commented 2 years ago

@christiansievers: I'm quite far regarding this change... the only issue is that running omxplayer as non root - (which is mandatory with cvlc - so better to figure out now) is that the image from the omxplayer process is just not visible... maybe you have some ideas and could try out the dev branch... I also opted to try to "harmonise" the install across different PI OSs by adding the pi user if non existent so the player can run under that user.

christiansievers commented 2 years ago

that's a lot of changes. I'll have a go when I find the time!

tofuSCHNITZEL commented 2 years ago

yeah sorry one thing led to another