added frame extraction plus code for optical flow calculation