sightmachine/SimpleCV

virtualCamera video loop issues /

carlesgutierrez opened this issue · 0 comments

Hello,
I've been struggle to try to read a video in loop mode. I did not find how to do it. Online Reference I'm now following is here

So , one way to get this somehow working -->

#global variables
cam = VirtualCamera('AbsolutePath/video.mov', 'video')
#functions
def setupVideo():
     cam = VirtualCamera('AbsolutePath/video.mov', 'video')
def updateVideo():
    img = cam.getImage()
    if img:
        img.show()
    else:
        print("end video so -> rewind")
        cam.rewind()

But check if there is or not a img, frezee my Raspberry pi for more than 4 seconds. So I've tried to find first the number of frames of my loaded video with findLastestImage but i've got following error:

while time.mktime(time.localtime()) - os.stat(max_full_path).st_mtime > 0.1:
TypeError: coercing to Unicode: need string or buffer, NoneType found

Any fixes, tips or different approaches are welcome. Thanks for your time!