Use of output-selector with webrtcbin and splitmuxsink

Hello team members,

I have been building an application where I can switch between sink applications for my video and audio device. Since, I am using a x86 system for the development, and using GStreamer 1.16.3

Now, coming to my gstreamer application, I am using a video source and audio source to stream both to a server using webrtcbin, and along with that if I have to do not stream to server, I need to save the same video and audio stream to local file, since only path needs to be active for this, so I am using output-selector as a source pads for both audio and video device, and using one active-pad as source for both audio and video, here is the sample pipeline, that I am using,

// Video source
"v4l2src device=/dev/video0 ! image/jpeg, width=1280, height=720, framerate=30/1 ! jpegdec ! videoconvert ! "

"x264enc tune=zerolatency key-int-max=30 bitrate=3000 ! video/x-h264, profile=baseline ! h264parse ! "

// Video output selector
"output-selector name=video_selector pad-negotiation-mode=1 resend-latest=false "

// WebRTC video path
"video_selector.src_0 ! queue name=video_queue max-size-time=2000000000 max-size-buffers=1000 ! "
"rtph264pay config-interval=1 pt=96 ! application/x-rtp, media=video, encoding-name=H264, clock-rate=90000, payload=96 ! "
"webrtcbin name=streambin sync=true async-handling=true "

// Local file video path (optional, inactive initially)
"video_selector.src_1 ! queue ! splitmuxsink name=splitmuxer max-size-time=10000000000 "
"muxer=mp4mux location=recorded_video_%%05d.mp4 async-finalize=false async-handling=false "

// Audio source
"alsasrc device="hw:0,7" ! audioconvert ! audio/x-raw, format=S16LE, channels=2, rate=16000 ! opusenc ! "

// Audio output selector
"output-selector name=audio_selector pad-negotiation-mode=1 resend-latest=false "

// WebRTC audio path
"audio_selector.src_0 ! queue name=audio_queue max-size-time=2000000000 max-size-buffers=1000 ! "
"rtpopuspay pt=97 ! application/x-rtp, media=audio, encoding-name=OPUS, clock-rate=48000, payload=97 ! streambin. "

// Local file audio path (optional, inactive initially)
"audio_selector.src_1 ! queue ! splitmuxer.audio_0 "

so in above pipeline, the active pads of the output-selector is set to stream the video and audio stream to webrtcbin, and other source pad is block of output-selector for both audio and video. I am not able to stream the audio and video using webrtcbin, but if change the pipeline in such a way that src_0 of output-selector is set to local file save using splitmuxsink for both audio and video, and it is properly saving the audio and video in a mp4 format in the local directory.

If I am using tee instead of output-selector for the same pipeline, then I am able to stream the video and audio using webrtcbin.

Can you guys please help me out to solve this issue, I will really appreciate it.

Regards,
Bear Griels