2017-10-12 12:00:32 +02:00
|
|
|
import os, hyperion, time
|
|
|
|
|
|
|
|
# Get the parameters
|
|
|
|
imageFile = hyperion.args.get('image')
|
|
|
|
framesPerSecond = float(hyperion.args.get('fps', 25))
|
|
|
|
reverse = bool(hyperion.args.get('reverse', False))
|
|
|
|
|
|
|
|
sleepTime = 1./framesPerSecond
|
2018-12-20 14:41:21 +01:00
|
|
|
imageList = []
|
|
|
|
|
2017-10-12 12:00:32 +02:00
|
|
|
if imageFile:
|
2018-12-20 14:41:21 +01:00
|
|
|
imageList = [reversed(hyperion.getImage(imageFile))] if reverse else hyperion.getImage(imageFile)
|
2017-10-12 12:00:32 +02:00
|
|
|
|
|
|
|
# Start the write data loop
|
|
|
|
while not hyperion.abort() and imageList:
|
|
|
|
for image in imageList:
|
2017-10-13 17:49:29 +02:00
|
|
|
hyperion.setImage(image["imageWidth"], image["imageHeight"], image["imageData"])
|
2017-10-12 12:00:32 +02:00
|
|
|
time.sleep(sleepTime)
|