Hello Staff,--I need to send via webRTC a RTP streaming starting from RTP. I mean:[sdpConfig.sdp] ---> [which component I have to use?] ---> WebrtcEndpoint(just for information, the sdp file that I have is this:v=0o=- 0 0 IN IP4 127.0.0.1s=No Namec=IN IP4 10.1.2.232t=0 0a=tool:libavformat 56.4.101m=video 5004 RTP/AVP 96b=AS:10a=rtpmap:96 H264/90000a=fmtp:96 packetization-mode=1)For streaming video I have always used PlayerEndpoint but in this case I've tried to use as address "rtp:/127.0.0.1:5004/" but it doesn't work. Which component do you think it will better to use? I'm thinking something aboutRtpEndpoint.connect(WebrtEndpoint)Using as SDPOffer the sdp file that I have. Do you think it make sense?Thank you for your help.Have a good work!
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
getKurentoClient(function(error, kurentoClient) { if (error) return callback(error); kurentoClient.create('MediaPipeline', function(error, pipeline) { if (error) return callback(error); createMediaElements(pipeline, function(error, rtpEp, webRtc) { if (error) { pipeline.release(); return callback(error); }
sdp_rtp = generateSDP(); rtpEp.processOffer(sdp_rtp, function(error, sdpAnswer) { if (error) { rtpEp.release(); return sendError(res, 500, error); }
webRtc.processOffer(sdpOffer, function(error, sdpAnswer) { if (error) { pipeline.release(); return callback(error); }
pipelines[sessionId] = pipeline;
rtpEpId[sessionId] = rtpEp; connectMediaElements(rtpEp, webRtc, function(error) { if (error) { pipeline.release(); return callback(error); } }); console.log("Everything should work..."); return callback(null, sdpAnswer); }); }); }); });});
function createMediaElements(pipeline, callback) {
pipeline.create('RtpEndpoint', function(error, rtpEp) { if (error) return callback(error);
pipeline.create('WebRtcEndpoint', function(error, webRtc) { if (error) return callback(error); return callback(null, rtpEp, webRtc); }); }); }
function connectMediaElements(rtpEp, webRtc, callback) { rtpEp.connect(webRtc, function(error) { if (error) return callback(error); }); return callback(null); } }
function generateSDP() { var sdp_rtp = ''; /* //VLC DUMMY MODULE sdp_rtp += 'v=0\r\n'; sdp_rtp += 'o=- 0 0 IN IP4 127.0.0.1\r\n'; sdp_rtp += 's=No Name\r\n'; sdp_rtp += 'c=IN IP4 127.0.0.1\r\n'; sdp_rtp += 't=0 0\r\n'; sdp_rtp += 'tool:libavformat 56.4.101\r\n'; sdp_rtp += 'm=video 5004 RTP/AVP 96\r\n'; sdp_rtp += 'b=AS:10\r\n'; sdp_rtp += 'a=rtpmap:96 H264/90000\r\n'; sdp_rtp += 'a=fmtp:96 packetization-mode=1\r\n'; */ //SDP FROM IVAN GARCIA sdp_rtp += 'v=0\r\n'; sdp_rtp += 'o=- 0 0 IN IP4 127.0.0.1\r\n'; sdp_rtp += 's=\r\n'; sdp_rtp += 'c=IN IP4 127.0.0.1\r\n'; sdp_rtp += 't=0 0\r\n'; sdp_rtp += 'm=video 5004 RTP/AVP 100\r\n'; sdp_rtp += 'a=rtpmap:100 H264/90000\r\n'; sdp_rtp += 'a=recvonly\r\n';
/* //VLC SDP sdp_rtp += 'v=0\r\n'; sdp_rtp += 'o=- 15651736854259072773 15651736854259072773 IN IP4 antonio-Lenovo-G585\r\n'; sdp_rtp += 's=Unnamed\r\n'; sdp_rtp += 'i=N/A\r\n'; sdp_rtp += 'c=IN IP4 127.0.0.1\r\n'; sdp_rtp += 't=0 0\r\n'; sdp_rtp += 'a=tool:vlc 2.1.6\r\n'; sdp_rtp += 'a=recvonly\r\n'; sdp_rtp += 'a=type:broadcast\r\n'; sdp_rtp += 'a=charset:UTF-8\r\n'; sdp_rtp += 'm=video 5004 RTP/AVP 33\r\n'; sdp_rtp += 'b=RR:0\r\n'; sdp_rtp += 'a=rtpmap:33 MP2T/90000\r\n'; */ return sdp_rtp; }
v=0
o=- 0 0 IN IP4 52.25.217.148
s=
c=IN IP4 52.25.217.148
t=0 0
m=video 26540 RTP/AVP 100
a=rtpmap:100 H264/90000
a=recvonly
v=0o=- 0 3646067584 IN IP4 52.25.217.148s=Kurento Media Serverc=IN IP4 52.25.217.148t=0 0m=video 54534 RTP/AVP 100a=rtpmap:100 H264/90000a=sendonlya=ssrc:3090531899 cname:user4024858172@host-c36acd93
Not really. What I meant was that you can feed the SDP from your external RTP source, as answer to the kms’s RTP generateOffer. Since you are negotiating SDP’s, which are basically a declaration of intentions/capabilities, if you feed your SDP to the processAnswer, your RTP endpoint in KMS should understand that the only candidate available in the SDP you’ve fed him is in the appropriate port where you are sending the video. If you do it the other way around, what you really are doing is you are instructing the RTP ep in KMS that it need to send the video to that port, so you are basically obtaining the opposite as expected.
Don’t know if that clarified things a bit… Just in case, suppose you have a mangledSdpForRtp
string. You should have to
rtp.createOffer()
rtp.processAnswer(mangledSdpForRtp)
And that should put your KMS rtp ep listening in that port.
I did as you wrote:
rtpendpoint.generateoffer()
rtpendpoint.processAnswer(cameraSDP, sdpAnswer)
But the sdpAnswer is still a random port from KMS and other things that werent on the cameraSDP.
Is there another way to this?
Many of these old apps\cameras just throw their rtp to some port, usually without even an sdp. (I created it for them and its working on vlc)
Thanks,
Israel Robotnick
Almost makes the who rtpendpoint unusable, all of my rtp feeds arrive on a port without me abling to change it. And what about multicast? That isnt only for kurento.
So strange