Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4941

Automation, sensing and robotics • Re: Utilizing GPIO with VLC Media player

$
0
0
A simple example with no error checking that runs OK on my Pi4 running Bookworm 64-bit

Code:

from gpiozero import Buttonfrom signal import pauseimport subprocessdef playvid():    result=subprocess.run(["cvlc", "/home/pi/Videos/bunny.mp4"], capture_output=False, text=True)button = Button(21)button.when_pressed = playvidpause()

Statistics: Posted by neilgl — Thu May 30, 2024 10:19 pm



Viewing all articles
Browse latest Browse all 4941

Trending Articles