simple code to capture 2 frames