rather use
assert frame is not None, "invalid image!"
and let it crash, where the problem is
(even IF it prints “error” (which tk likely swallowed), it’ll still fail later)
please also debug the lines above in a similar way
(did it really connect ? load an image ? succeeded to decode it ? something went wrong there !)
btw, imho, flip()
should already throw an exception, but doesn’t ;(