Improve video input frames detection