Changing filesrc of WebRTC dynamically

I’m using the webRTC bin to stream some video (mp4) files. I’m using a pipeline like this.

pipeline = ‘’’ webrtcbin name=sendrecv bundle-policy=max-bundle splitfilesrc location={} ! qtdemux name=demux demux.video_0 ! h264parse ! rtph264pay config-interval=-1 ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! sendrecv. '‘’

Here I’m using splitfilesrc instead of filesrc because it can change the source file dynamically.

But however when I run the webrtc application, I try to dynamically change the splitfilesrc location to something else, But I can see that element’s location changes but nothing happens in the webRTC stream.

WebRTC stream seems to be frozen.

Can I keep the webRTC connection open and change the file source like this?

Are there any alternative methods to this?

This might be unrelated, but when i was playing with one playbin streaming to two and more webrtcbin connecting dynamically i needed to send event “seek” to playbin to properly continue streaming after connecting new webrtcbin to the pipeline. Without it the stream used to “freeze”.

so instead of a filesrc you were using a playbin and to stop freezing the pipeline you sent a ‘seek’?

Exactly. And the event procedure was:

  1. gst_element_query_position (from the pipeline)
  2. gst_event_new_seek/gst_element_send_event to one of elements in the pipeline (see more about seek-ing on playbin in GStreamer docs, there is a special section for that)
1 Like