Hello everyone!
I have made some progress (I believe) in trying to modify a hello world tutorial such that I create the following pipeline WebrtcEndpoint --> RtpEndpoint --> ffplay client
The RtpEndpoint should be only sending the stream and the ffplay client will only be receiving i.e., the stream is unidirectional from KMS to the ffplay client.
(please note. I read many other threads on this forum, Googled, but have not been able to find anything that would lead to the video working).
I have written the following code (server.js modified from the hello world tutorial is attached):
.
.
.
sdp = "v=0";
sdp += "\no=- 0 0 IN IP4 127.0.0.1";
sdp += "\nm=video 5000 RTP/AVP 96";
sdp += "\nc=IN IP4 127.0.0.1";
sdp += "\na=sendonly"
sdp += "\na=rtpmap:96 H264/9000";
pipeline.create('RtpEndpoint', function(err, rtpEndpoint){
rtpEndpoint.processOffer(sdp);
webRtcEndpoint.connect(rtpEndpoint, function(err, rtpEndpoint) { if(err) { console.log("Error!"); } });
});
As you can see above, just for testing purposes, I am currently assuming that ffplay will be running on the same system (localhost) where KMS is hosted.
I then wrote the following SDP file for use by ffplay:
foo.sdp:
v=0
o=- 0 0 IN IP4 127.0.0.1
m=video 5000 RTP/AVP 96
c=IN IP4 127.0.0.1
a=recvonly
a=rtpmap:96 H264/90000
I then run ffplay -i foo.sdp
It just outputs the stuff below and then hangs.
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
After struggling with it for a while, I decided to perform a more rudimentary check; is the data even arriving at the specified port?
Hence, I used netcat as follows:
$ netcat -l -u 127.0.0.1 5000
(i.e., listen on the UDP port of 5000 on the local host and output any data that arrives to the terminal).
However, the command just hangs, which means there is no data arriving.
Hence, my conclusion is that KMS is not sending the data.
Am I messing up my SDP configuration somehow? What am I doing wrong? Please help!
I found the following links to be helpful, but ultimately they did not avail to success.
And many others