Can you share a demo/ pipeline where I am able to receive my own video using webrtcbin on a browser
Opened this issue · 14 comments
All the demos I see are either some static media flowing either from browser to server or server to browser.
Do you have a demo where the browser sends video and gets the same video back as a remote stream from server using webrtcbin?
Or an example pipeline for the above scenario?
any help would be appreciated.
I am in same boat. can anyone help with sample apps for webrtcbin for C# or C++?
The way to implement that in GStreamer is to have an appsrc ! webrtcbin ! appsink pipeline, and to manually feed buffers from appsink back into the appsrc
One way could be Browser(RTCPeerConnection1[sendonly]) -> webrtcbin1 -> rtpvp8depay -> rtpvp8pay -> webrtcbin2 -> Browser(RTCPeerConnection2[recvonly])
What I observed is webrtcbin as sender(webrtcbin2 in above case) is not generating offer sdp until pipeline goes to playing state and media flowing (i.e, input received from webrtcbin1 )
Yes, that will also work if you don't mind separate PeerConnections and the delay in negotiating the 2nd link
@sampleref : How are you calling the webrtcbin from a browser? Can you please share a sample app?
@sampleref : How are you calling the webrtcbin from a browser? Can you please share a sample app?
webrtcbin is not called from browser, as per https://webrtc.org/getting-started/peer-connections RTCPeerConnection is the reference point for each webrtc session in javascript/browser, similarly webrtcbin is the GStreamer end reference for RTCPeerConnection
Its like 2 peers( RTCPeerConnection in browser <==> webrtcbin in GStreamer ) connected in a webrtc session, each of them emit their local SDP(Media Description) and ICE(Connection Information) and provide api to accept those 2 details from remote peer, the custom signalling plane, which can be your browser websocket connection/ajax should exchange this info between 2 peers
Earlier I was exploring an example https://github.com/sampleref/push2video which shows example code to send and receive media from browser from webrtcbin
Please let me know if you need more info
@sampleref : Thanks for the info. Can you please answer this question: ndndemos/gstreamer_support_demo#1
Please scroll down to the bottom of the page.
@sampleref : Sorry for the wrong link. Can you please answer this: VolDonets/webrtc_gst_pc#1
/--->webrtcbin1(sendrecv)---->\
/ \
/ /--->webrtcbin2(sendrecv)--->\ \ /\
---->queue--->tee-- ----->input-selector |--->
| \ \--->webrtcbin3(sendrecv)--->/ / \/ |
| \ / |
| \--->webrtcbin4(sendrecv)---->/ |
| |
| |
^--------------------------------<--------------------------------------------<
@thaytan I was looking to implement the use case as above, here I shall control at a time only 1 webrtcbin which can be selected as input source or none
Is appsink->appsrc linking required to achieved this or can be done within single pipeline as above?
No, you can't have cycles in the GStreamer graph. Ferrying GstSamples from appsink to appsrc with a callback breaks the cycle
No, you can't have cycles in the GStreamer graph. Ferrying GstSamples from appsink to appsrc with a callback breaks the cycle
Ok, can this appsink -> appsrc be in same pipeline, or are meant only to connect 2 different pipelines?
And can I use proxysink->proxysrc in place of appsink -> appsrc similarly?
No, you can't have cycles in the GStreamer graph. Ferrying GstSamples from appsink to appsrc with a callback breaks the cycle
Ok, can this appsink -> appsrc be in same pipeline, or are meant only to connect 2 different pipelines?
And can I use proxysink->proxysrc in place of appsink -> appsrc similarly?
Yes, it works with proxysink->proxysrc, in a single pipeline,
If you have a local server you can send the media to the server, the server can echo the data back and then you can reconstruct the stream at the browser. See also https://github.com/w3c/webrtc-insertable-streams.
Do you have a demo where the browser sends video and gets the same video back as a remote stream from server using webrtcbin?
What are you actually trying to achieve by sending video to an environment other than the browser and getting the "same" video back?