So, I am trying to make a face recognition app using the OpenCV library. I am successfully able to detect the faces of the people using haarcascade. I am currently using the javaCameraView to show the live feed of the camera. I want to capture the person's picture or record a video when their face is being detected. I tried using onPictureTaken method but it has been deprecated as of android 5.0