Is it possible to stop capturing the video before 2 seconds?

I am stopping the capturing video whenever death event got occurred by using I want to the video should not capture before one/two seconds of the death.

I understood video is getting stopped whenever event occurs and the captured video has death frames too.but I want to remove that part from video. May I know how to do that?


Please check the createVideoComposition API:


In order to use this then I need to know the video length then I can subtract the 1 second from the video. May I know, How to get that?