Camerax VideoCapture max duration limit

I am using Camerax to record a video, one of the requirement is to set the maximum duration to 15 seconds, how to do that?