Domanda

Peers must be able to forward data in order to broadcast in a peer-to-peer overlay (such as Chord). When each node (peer) receives data it will then forward the data to all other nodes in their routing table, who will then forward the same data again until all nodes in the ring receives the data. eg, structured p2p WebRTC broadcasting requires a means of forwarding WebRTC video streams.

In my understanding, the javascript WebRTC API is designed to allow the developer to setup connections but not handle media streams directly. That a high-level video object is 'plugged' into the connection object to consume the video stream with no lower level access to the video data.

The questions

  1. Is there any way to reach raw video streams within a WebRTC client?
  2. Is there any form of raw consumer objects or forwarding/relay objects in WebRTC?
È stato utile?

Soluzione

It's certainly possible to forward an incoming stream from one RTCPeerConnection to another. Here's an example: https://github.com/git-matrix/webrtc/tree/master/samples/web/content/peerconnection/multiple-relay However, you don't get low-level access to the frames in this scenario, and the content will be decoded and re-encoded instead of being passed through as-is.

Altri suggerimenti

Well first of all, I think I have managed to relay A's video to C. Since I am testing with only one PC (laptop) and two different camera's I am not 100% certain, but I think I have done it, it seems RTCPeerconnection is able to take a remote stream.

Btw, I am using the easyrtc library since I can't find any workable simple codes to test with.

So the basic idea should be,

A grabs the event video. B connects to A,

B saves the remote stream reference received from A;

C connects to B,

B instead of passing local media stream, hands the remote media stream to C;

C would save that remote media stream;

When D connects to C, C would hand the remote media stream received from B (which actually has been received originally from A) to D

and like wise, the flow continues... i.e A's media stream passes like a Wave through B, C, D , E....

Notice that the connection flow should look like this: A<-->B<-->C<-->D<-->E... every node has only two connection.. with the previous node and the next node.

However, long story short - Yes, you can access the media stream and hand it to another remote connection

I just need an expert who can give me a working raw JS based webrtc code where A connects with B and vice versa.. and I would try to write C connecting with B and D connecting with C codes for proper testing.

  1. No, there isn't on the client side. You have to send it to the server and there you can do pretty much whatever you want.
  2. You have to open a separate peer connection for each peer you want to forward to.

Source: http://www.youtube.com/watch?v=E8C8ouiXHHk

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top