pretty straight forward task, what are you using for face detection, depending on it, its a easy task, simply using a buffer to store the frames and save them into mp4 file. feel free to check my profile for past projects and reviews or text me to discuss further.