Gstreamer extract only selected ranges of video

Hi, I want to extract segments from this video from predefined timestamps and merge them into single video.

I have existing gstreamer pipeline that process video, so i would like to use gstreamer to avoid decoding video twice.

I do not care about the audio, and I am comfortable writing my own plugin, just need a direction where should i start.

I found this, that suggested i can use Gst.PadProbeReturn.DROP to drop frames, so i could check if current time is inside predefined timestamp and if not i could drop them but in the thread they say that there could be problems with the framerate, also i don’t know how to get current time inside custom python plugin.