Jetson video editing

Hi,
I am planning to record the camera continuously with filenames having date time. I also would be having one more python program which would be listening to an external event, upon receiving the external event, it starts building video for a given time frame. For example, if external event says, it needs a video from 10:30 to 11.15, program needs to take two videos and capture frames between the time frames. What is the best-optimized solution to start looking for frames within the video, also can I use GStreamer to fetch end video by getting frames from two or more video files.