I have a gstreamer pipeline where I get a rtsp stream from a mobile app and I both save it to a file and send to a virtual v4l2loopback device.
The pipeline is this:<