The full FFmpeg command to copy-paste:
ffmpeg -hide_banner -y -loglevel error -rtsp_transport tcp -use_wallclock_as_timestamps 1 -i rtsp://username:[email protected]:554/stream1 -vcodec copy -acodec copy -f segment -reset_timestamps 1 -segment_time 900 -segment_format mkv -segment_atclocktime 1 -strftime 1 %Y%m%dT%H%M%S.mkv
The input stream URL is for a Tapo C310 camera with the RTSP username and password "username" and "password".
I've put a fair bit of experimentation into the settings in this command. I've included the what and whys below, as well as a camera recommendation for RTSP.