Skip to content

Instantly share code, notes, and snippets.

@lesp
Created June 27, 2022 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesp/788c6a9dc8b6fbc0d6d935511a61193f to your computer and use it in GitHub Desktop.
Save lesp/788c6a9dc8b6fbc0d6d935511a61193f to your computer and use it in GitHub Desktop.
BMO Playback
from gpiozero import Button #Much easier way to interact with the GPIO
from omxplayer.player import OMXPlayer
from pathlib import Path
from time import sleep
from signal import pause
button = Button(17) #Physical pin 11
def video_test():
VIDEO_PATH = Path("BMO_DontSayThings.mp4")
player = OMXPlayer(VIDEO_PATH, args=['-o', 'alsa'])
player.set_aspect_mode('stretch')
player.set_rate(0.95)
sleep(5)
player.quit
print ("Success!")
while True:
button.when_pressed = video_test
pause()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment