Gstreamer WebRTC SFU

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

Gstreamer WebRTC SFU

roy_ros
Hello im developing an SFU with gstreamer for my university final degree
project.

My problem is when i try to connect the webrtcbin1 srcpad is created with
the browser stream to the webrtbinc2 sinkpad and negotiates with the
webrtcbin2 to another browser so the 2nd browser can see the stream of the
browser 1.
Even though the browser 2 is getting the media of the browser 1 ( it apears
when i do pc.getRemoteStreams() in the browser console) the media doesnt
plays.

To do this i have the following pipeline structure:

webrtcbin1_srcpad_Browser_1 ! rtpvp8depay ! vp8dec ! videoconvert ! tee
name=t ! queue ! vp8enc ! rtpvp8pay ! queue !
application/x-rtp,media=video,payload=96,encoding-name=VP8 ! webrtcbin
name=wrbinB2

and take the wrbinB2 and negotiate to the browser 2 ( this happens when the
browser 1 fires the signal pad-added on the webrtcbin1), the negotiation
with the browser 2 is correct and i get no errors in the gst.c nor
browser.js.

I probably do the conversion in a wrong way but i dont know how would be to
connect one webrtcbin srcpad to the sinkpad of another webrtcbin

Thank you so much in advance!



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

Re: Gstreamer WebRTC SFU

Matthew Waters
This sounds like it should work if you get the timing and signalling right.

I'm not sure exactly what the problem is from your description.

Cheers
-Matt

On 30/03/18 04:29, roy_ros wrote:

> Hello im developing an SFU with gstreamer for my university final degree
> project.
>
> My problem is when i try to connect the webrtcbin1 srcpad is created with
> the browser stream to the webrtbinc2 sinkpad and negotiates with the
> webrtcbin2 to another browser so the 2nd browser can see the stream of the
> browser 1.
> Even though the browser 2 is getting the media of the browser 1 ( it apears
> when i do pc.getRemoteStreams() in the browser console) the media doesnt
> plays.
>
> To do this i have the following pipeline structure:
>
> webrtcbin1_srcpad_Browser_1 ! rtpvp8depay ! vp8dec ! videoconvert ! tee
> name=t ! queue ! vp8enc ! rtpvp8pay ! queue !
> application/x-rtp,media=video,payload=96,encoding-name=VP8 ! webrtcbin
> name=wrbinB2
>
> and take the wrbinB2 and negotiate to the browser 2 ( this happens when the
> browser 1 fires the signal pad-added on the webrtcbin1), the negotiation
> with the browser 2 is correct and i get no errors in the gst.c nor
> browser.js.
>
> I probably do the conversion in a wrong way but i dont know how would be to
> connect one webrtcbin srcpad to the sinkpad of another webrtcbin
>
> Thank you so much in advance!
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer WebRTC SFU

roy_ros
Thanks for the answer.

My problem is that the browser 2 even it get a media stream it doesnt play.

The structure is like: Browser1 -> webrtcbin1 -> Decoding vp8 ->
videoconvert -> Coding vp8 -> webrtcbin2 -> Browser2

I dont know what is wrong, the negotiations are okay, and if instead of
Coding again and send i try to stream it with xvimagesink it works.
Btw the negotiation of the webrtcbin2 the offer it has no framerate=30
option as the first negotiation with webrtcbin1 have.

I have also thought about do simply B1 -> webrtcbin1 -> webrtcbin2 -> B2 but
i dont think could works right?

Thanks for the help! here i leave my git repository so you can take a look
if you want.

https://github.com/RosCoCorp/Gstreamer-WebRTC-SFU



Roy
University of Strathclyde




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

Re: Gstreamer WebRTC SFU

Nirbheek Chauhan
On Fri, Mar 30, 2018 at 10:58 PM, roy_ros <[hidden email]> wrote:
> Thanks for the answer.
>
> My problem is that the browser 2 even it get a media stream it doesnt play.
>
> The structure is like: Browser1 -> webrtcbin1 -> Decoding vp8 ->
> videoconvert -> Coding vp8 -> webrtcbin2 -> Browser2
>
> I dont know what is wrong, the negotiations are okay, and if instead of
> Coding again and send i try to stream it with xvimagesink it works.

One thing to note is that webrtcbin must go to PLAYING only after sink
pads have been requested on it, otherwise it will create an empty SDP.
So when you get the pad-added signal on webrtcbin1, you should create
the `decoder ! videoconvert ! encoder` branch, then create webrtcbin2,
add both to the pipeline, link them, and sync their state with the
parent pipeline.

Then you'll receive on-negotiation-needed and so on for webrtcbin2.

> Btw the negotiation of the webrtcbin2 the offer it has no framerate=30
> option as the first negotiation with webrtcbin1 have.
>
> I have also thought about do simply B1 -> webrtcbin1 -> webrtcbin2 -> B2 but
> i dont think could works right?
>

This should work fine. You should only need to depayload the vp8 and
payload it again without decoding/encoding it.

Hope that helps!

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

Re: Gstreamer WebRTC SFU

roy_ros
Thanks for answer, i did how you said but now i found the problem what is
that the srcpad and the sinkpad doesnt link, this is where i do it:

<http://gstreamer-devel.966125.n4.nabble.com/file/t378257/create_branch_and_link_pads.png>
then i just connect the signals and
gst_element_sync_state_with_parent(outBin);

So i have two diferent options to get the sinkpads of the outBin, the first
one get a padType: x-srtcp the second one is the right x-rtp, even though
both ways get GST_PAD_LINK_FAILED == FALSE, then with both ways i got
gst_pad_is_linked == FALSE.

So the problem should be that the src new_pad doesnt link with the sinkPad i
create, thats why i got an empty stream to the browser 2 because webrtcbin2
SDP is empty.

Im pretty sure the problem is about how i do my outBin, i order the queues
wrong or i miss some converter or other component.
Maybe i need to link one for one instead do a parse_bin_from_description but
i have tried everything and it doesn't works.

Could you say how should do the branch of components to link the src new_pad
with the new webrtcbin2 and make it work?

Thank you so much!!!


Github project:
https://github.com/RosCoCorp/Gstreamer-WebRTC-SFU
<https://github.com/RosCoCorp/Gstreamer-WebRTC-SFU>  


Roy
University of Strathclyde



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel