How to play a rtsp stream as well as persist on the disk

I am trying to capture a rtsp stream to disk at the same time show it.

gst-launch-1.0 rtspsrc location=‘rtsp://admin:xxxx1234@192.168.1.41:554/cam/realmonitor?channel=1&subtype=0’ latency=200 protocols=tcp ! rtph264depay ! h264parse ! tee name=t !
queue ! qtmux ! filesink location=rtsp-stream.mp4 t. !
queue ! nvv4l2decoder ! nvvidconv ! nv3dsink -e

The above pipeline works independently but when I use tee to split the stream and do both the display does not work.

Any pointers to what I may be doing wrong?

Thanks

Hi,
Please run

$ gst-launch-1.0 rtspsrc location='rtsp://127.0.0.1:8554/test' latency=200 ! rtph264depay ! tee name=t ! queue ! h264parse ! qtmux ! filesink location=rtsp-stream.mp4 t. ! queue ! h264parse ! nvv4l2decoder ! nvvidconv ! nv3dsink -e

Sink pad of qtmux requests stream-format=avc and nvv4l2decoder requests stream-formar=byte-stream. you need two h264parse.

Thanks for your help. It worked like a charm.
Where was this mentioned? How do I learn to resolve issues like these?