New question #266829 on Sikuli:
https://answers.launchpad.net/sikuli/+question/266829

Hi, I have a script for verifying that a movie is streaming. If the movie have 
stopped the script will fail. 
The problem is that "if exists(img,0)" takes over 10 seconds for me to execute. 
Why? 
The region is the entire screen, since it is a movie playing in full screen. 
But shouldn't the comparison fail immediately if it can't see similarities? I 
have tried fiddeling with WaitScanRate and ObserveScanRate without success. 

Example:
---------------------------------------------------------------------------------------
app = getRegionOfApp()
duration = 30
time = datetime.datetime.now().time()
endTime = addSecsToTime(time, duration)

img = capture(app)
wait(5)
while datetime.datetime.now().time() < endTime:
    print "time before if: ", datetime.datetime.now().time()

    if exists(img,0):
        assert False
        print "video seems to have stopped"

    print "time after if: ", datetime.datetime.now().time()    

    img = capture(app)
    wait(5)
print "video played fine in %s seconds" % (duration)

-----------------------------------------------------------------------------------------
[output]
time before if: 16:02:51.005000
time after if: 16:03:01.772000

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to