Loading x3 omxplayers in Python - Raspberry Pi Forums


hi all,

new python , pi - please excuse incorrect terminology!

have been looking @ trying load x3 different animations in python, not @ same time. main task them playing with clicker analog switch (when dial/switch turned position, new animation played on screen in different location).

hope above made sense.

now, have managed load 1 animation (mp4) script able change location , able activate simple push switch. next task assign code 3 can played.

code pasted below:

omxplayer import omxplayer
gpiozero import button

startbutton = button(2)


##def pressed(button):
## print(str(button.pin.number))
def pressed():
filepath = 'w1.mp4'


top = 0
left = 0
width = 400
height = 400


sizes1 = str(left) + ' ' + str(top) + ' ' + str(left + width) + ' ' + str(top + height)

player = omxplayer(filepath, args=['--win', sizes])

player.play()


startbutton.when_pressed = pressed



in advance everyone.



raspberrypi



Comments