Tee element after source disrupts the pipeline

I’m trying to build a pipeline that receives a RTP stream and sends the raw UDP packets through 2 branches, one for display (autovideosink) and another for relaying the packets to another host (udpsink). This is the desired pipeline:

gst-launch-1.0 udpsrc port=5000 caps="application/x-rtp, payload=96" ! tee name=t \
    t. ! queue ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink 
    t. ! queue ! udpsink host=192.168.1.155 port=6000

The problem is that the pipeline doesn’t display the video, neither it forwards packets to the remote host, instead it gets stuck in a neverending state:

Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

I tried debugging the issue and this is what I discovered so far:

  • I tried placing the tee element after the rtph264depay element, and in this case the pipeline works corretly. Still, I don’t want to forward processed packets like here, but raw UDP packets!
gst-launch-1.0 udpsrc port=5000 caps="application/x-rtp, payload=96" ! rtph264depay ! tee name=t \
    t. ! queue ! avdec_h264 ! videoconvert ! autovideosink 
    t. ! queue ! udpsink host=192.168.1.155 port=6000
  • I also tried running the 2 branches separately onto different pipelines and, taken alone, they work perfectly:

“1st brach”: correctly displays the streamed video:

gst-launch-1.0 udpsrc port=5000 caps="application/x-rtp, payload=96" ! tee name=t \
    ! queue ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink

“2nd brach”: correctly forwards received raw UDP packets to the remote host:

gst-launch-1.0 udpsrc port=5000 caps="application/x-rtp, payload=96" ! tee name=t \
    ! queue ! udpsink host=192.168.1.155 port=6000

What am I doing wrong? Why does the pipeline fall apart when using the 2 branches in the same pipeline?