https://discourse.gstreamer.org/t/dynamically-record-video/1372/2

https://gstreamer.freedesktop.org/documentation/togglerecord/index.html?gi-language=c

gst-launch-1.0 -e rtspsrc location=rtsp://admin:yangquan123@192.168.10.11:554/Streaming/Channels/101 protocols=0x04 ! rtph265depay ! h265parse ! mp4mux ! filesink location=output.mp4

gst-launch-1.0 -e rtspsrc location=rtsp://admin:yangquan123@192.168.10.12:554/Streaming/Channels/101 protocols=0x04 ! rtph264depay ! h264parse ! mp4mux ! filesink location=output.mp4