0

Inconsistent Sleep() time with slideshow.

I'm using an up-to-date HD224 to play back 10 images for a museum exhibition on a 4K monitor. The images look and play back perfectly but I've been requested to have the image on for 30 seconds, then cut to black for 2 seconds, then continue on to the next image. 

Here is the code:

 

VideoMode$ = "3840x2160x60p"

mode=CreateObject("roVideoMode")
mode.SetMode(VideoMode$)

v=CreateObject("roVideoPlayer")

rectangle = CreateObject("roRectangle", 0, 0, 1920, 1080)
v.SetRectangle(rectangle)

v.SetTransform("rot90")
v.SetViewMode(1)

imageNumber=1
totalImages=10

play:

v.PlayStaticImage(imageNumber.ToStr()+".jpg")
Sleep(30000)
goto switch

switch:
v.StopClear()
'sleep(2000)
imageNumber=imageNumber+1
if imageNumber>totalImages then
imageNumber=1
endif
goto play

 

------------------

The issue is that it plays the image properly for 30 seconds, and then cuts to black for around 4 seconds, then back to the next image. Setting the second Sleep to something like 30000 works! It waits for 30 seconds, but for some reason I can't get it under ~3-4 seconds. Is this a loading issue?

When I comment out the second Sleep(2000), the image still cuts to black for a just a little under 2 seconds. Unfortunately this needs to be consistent (exactly 2 seconds) and not based on however long it takes to load the image into memory... as I assume that will always be slightly different depending on the size of the file.

These ARE 4k jpegs, but are only about 10mb in size each, so I'm not sure why they'd take that long to load to memory. Alternatively, I tried v.Show() and v.Hide(), but they don't seem to work with PlayStaticImage(). Unless I'm missing something? StopClear() was the only thing that properly removed the image from screen... as well as loading a black jpeg (but that's a rough hack I don't want to have to resort to).

Any ideas? Why does Hide/Show not work for PlayStaticImage? Is there a more consistent way to use Sleep()? To dump the image off screen?

Thanks!

0 comments

Please sign in to leave a comment.