using opencv for video input. works for webcam.