Live video input detection algorithm