webrtcbin issue

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

webrtcbin issue

Vladimir Tyutin
Hi there,
I'm trying to restart webrtc gstreamer plugging without restarting the whole pipeline. The reason for that is that in pipeline I have capturing to ts files that are uploaded to server. So I can't stop whole pipeline but only webrtc branch. 
See my pipeline below. 
The steps I do to restart webrtc are the following:
1. Add blocking prob on src pads for audio and video queue after tee elements
2. Once it's blocked I remove video and audio branches elements from pipeline together with webrtcbin element and set them to NULL state
3. Create webrtcbin and video/audio branched elements and add them to pipeline
4. Link elements
5. Unblock queue src pads.

With this sequence I observe the following issues:
1. Sometimes queue src pads are not blocked. I see event from one pad about blocking state but not from another.  But I'm waiting both pads blocking events to proceed
2. When both are blocked. Sometime (very frequently) webrtcbin hangs in switching to NULL state. I see it tries to switch all its internal elements to NULL state and hangs somewhere inside
3. If both previous issues not happened when I start new webrtc session audio is not received on client side despite SDP data contains valid audio data

Do you have any idea what is the proper way to restart webrtcbin element inside pipeline and prepare it to new connection?

Here is my pipeline:
"webrtcbin name=webrtc " STUN_SERVER_PROP "=" STUN_1 " " STUN_SERVER_PROP "=" STUN_2 " " STUN_SERVER_PROP "=" STUN_3 " " \
                    STUN_SERVER_PROP "=" STUN_4 " " STUN_SERVER_PROP "=" STUN_5 " " TURN_SERVER_PROP "=" TURN_1 " " \
                    "mpegtsmux name=fullhdts ! hlssink max-files=100 target-duration=10 location=/mnt/ramdisk/fullhd_%09d.ts " \
                    "mpegtsmux name=vgats ! hlssink max-files=100 target-duration=10 location=/mnt/ramdisk/vga_%09d.ts " \
                    "v536videosrc sys-init=false device=1 channel=0 encoder=0 format=H264 width=1920 height=1080 ! video/x-h264, stream-format=byte-stream, alignment=au, profile=baseline ! queue ! h264parse ! fullhdts. " \
                    "v536videosrc sys-init=false device=1 channel=1 encoder=1 format=H264 width=640 height=480 ! video/x-h264, stream-format=byte-stream, alignment=au, profile=baseline ! tee name=tv ! queue ! h264parse ! vgats. " \
                    "alsasrc ! tee name=t ! queue ! avenc_aac ! aacparse ! fullhdts. " \
                    "t. ! queue ! avenc_aac ! aacparse ! vgats. " \
                    "tv. ! queue name=videoqueue leaky=downstream max-size-buffers=25 ! rtph264pay name=vrtp ! capsfilter name=vrtpcaps caps=" RTP_CAPS_H264 "96 ! webrtc. " \
                    "t. ! queue name=audioqueue leaky=downstream ! audioconvert name=aconvert ! opusenc name=opusenc ! rtpopuspay name=artp ! capsfilter name=artpcaps caps=" RTP_CAPS_OPUS "97 ! webrtc. "

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: webrtcbin issue

Vladimir Tyutin
Hi all,
Is there any response on the issue below?

On Thu, Jan 14, 2021 at 10:35 PM Vladimir Tyutin <[hidden email]> wrote:
Hi there,
I'm trying to restart webrtc gstreamer plugging without restarting the whole pipeline. The reason for that is that in pipeline I have capturing to ts files that are uploaded to server. So I can't stop whole pipeline but only webrtc branch. 
See my pipeline below. 
The steps I do to restart webrtc are the following:
1. Add blocking prob on src pads for audio and video queue after tee elements
2. Once it's blocked I remove video and audio branches elements from pipeline together with webrtcbin element and set them to NULL state
3. Create webrtcbin and video/audio branched elements and add them to pipeline
4. Link elements
5. Unblock queue src pads.

With this sequence I observe the following issues:
1. Sometimes queue src pads are not blocked. I see event from one pad about blocking state but not from another.  But I'm waiting both pads blocking events to proceed
2. When both are blocked. Sometime (very frequently) webrtcbin hangs in switching to NULL state. I see it tries to switch all its internal elements to NULL state and hangs somewhere inside
3. If both previous issues not happened when I start new webrtc session audio is not received on client side despite SDP data contains valid audio data

Do you have any idea what is the proper way to restart webrtcbin element inside pipeline and prepare it to new connection?

Here is my pipeline:
"webrtcbin name=webrtc " STUN_SERVER_PROP "=" STUN_1 " " STUN_SERVER_PROP "=" STUN_2 " " STUN_SERVER_PROP "=" STUN_3 " " \
                    STUN_SERVER_PROP "=" STUN_4 " " STUN_SERVER_PROP "=" STUN_5 " " TURN_SERVER_PROP "=" TURN_1 " " \
                    "mpegtsmux name=fullhdts ! hlssink max-files=100 target-duration=10 location=/mnt/ramdisk/fullhd_%09d.ts " \
                    "mpegtsmux name=vgats ! hlssink max-files=100 target-duration=10 location=/mnt/ramdisk/vga_%09d.ts " \
                    "v536videosrc sys-init=false device=1 channel=0 encoder=0 format=H264 width=1920 height=1080 ! video/x-h264, stream-format=byte-stream, alignment=au, profile=baseline ! queue ! h264parse ! fullhdts. " \
                    "v536videosrc sys-init=false device=1 channel=1 encoder=1 format=H264 width=640 height=480 ! video/x-h264, stream-format=byte-stream, alignment=au, profile=baseline ! tee name=tv ! queue ! h264parse ! vgats. " \
                    "alsasrc ! tee name=t ! queue ! avenc_aac ! aacparse ! fullhdts. " \
                    "t. ! queue ! avenc_aac ! aacparse ! vgats. " \
                    "tv. ! queue name=videoqueue leaky=downstream max-size-buffers=25 ! rtph264pay name=vrtp ! capsfilter name=vrtpcaps caps=" RTP_CAPS_H264 "96 ! webrtc. " \
                    "t. ! queue name=audioqueue leaky=downstream ! audioconvert name=aconvert ! opusenc name=opusenc ! rtpopuspay name=artp ! capsfilter name=artpcaps caps=" RTP_CAPS_OPUS "97 ! webrtc. "

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel