Which configuration in the config.lua do I use for pushing an RTSP stream to EvoStream?

Support ForumCategory: About EvoStreamWhich configuration in the config.lua do I use for pushing an RTSP stream to EvoStream?
BillMalkin Member asked 2 years ago

Hi

Just a simple question hopefully. I’m attempting to push a stream from an Android app I’m developing to EMS where I want to convert it to RTMP and display the video on a website using FlowPlayer’s JavaScript API. I’m using an API on the Android phone called Libstreaming. This all worked through Wowza and now I’m keen to get it working through EMS. (Admittedly, the code I’m using on the Android phone was developed by a third party as an example of how the Libstreaming API is used and was written specifically to work with Wowza. However, they maintain it “should” also work with other streaming engines.)
In config.lua it would appear that I should therefore connect to inboundRTSP, ie
— RTSP
{
   ip=”0.0.0.0″,
   port=5544,
   protocol=”inboundRtsp”,
}
However, when attempting to get this all working with crtmpserver, I read some documentation that said I should be using inboundLiveFlv, ie
— LiveFLV ingest
{
   ip=”0.0.0.0″,
   port=6666,
   protocol=”inboundLiveFlv”,
   waitForMetadata=true,
}
Could you confirm that I should indeed be using inboundRTSP before proceeding?
(I ask because I get an error when trying to connect with either port.)
Very much appreciated.
Kind regards
Bill

16 Answers
erika Evostream-Staff answered 2 years ago

Hi Bill,
For your question: 
“Which configuration in the config.lua do I use for pushing an RTSP stream to EvoStream?”
If you want to ingest the stream from your Android to EMS, you can pull the stream using RTSP then you can use RTMP for stream playback. EMS will do the conversion for you. 🙂

  1. pullStream RTSP source: 
    pullStream uri=rtsp://<SOURCE_Address> localStreamName=Test
  2. playback RTMP: 
     rtmp://<EMS_IP>/live/Test

 
Thank you.
 
 

BillMalkin Member answered 2 years ago

Hi Erika
I couldn’t actually understand your answer above. This is because (a) I’m using a push-in stream rather than a pull stream, and (b)  “pullStream uri=rtsp://<SOURCE_Address> localStreamName=Test" does not seem to fit the config.lua syntax.

In any case, I've now discovered that when adding a stream in EMS ONLINE, it adds the configuration to pushPullSetup.xml and I really don't need to change config.lua in order to set up an RTSP stream. Would that be correct?
So I’ve added a stream using EMS ONLINE and in the Config panel it shows a Config ID of 3, LocalStreamName of myStream2, and Source URI of rtsp://139.162.97.151:5544/live.

Does this look like the correct configuration for a push-in RTSP stream?
(It seems odd that, even though the port default for RSTP in Config.lua is 5544, if I don’t specify 5544 in the Source URL it defaults to port 554.)
When I use this configuration, I run “service evostreamms start_console” and it shows the output below repeated over and over until I stop EMS. This is occurring even though I am not even attempting to connect to EMS. It seems as if it is trying to both connect to an outside listener, as well as listen for my connection, and it keeps failing on connecting to an outside listener. Would that be correct? In any case, how do I address this apparent problem as , when I do attempt to connect to the EMS listener, there is no evidence that EMS accepts the connection at all?

(I’ve run sniffit on port 5544 and my app definitely does attempt to connect to the EMS listener on that port.)
Thanks. (I’ve also emailed you the log file.)
Cheers
Bill
 
/thelib/src/netio/epoll/iohandlermanager.cpp:119 Handlers count changed: 23->24 IOHT_TCP_CARRIER
/thelib/include/netio/epoll/tcpconnector.h:112 Outbound connection established: (Far: 139.162.97.151:5544; Near: 139.162.97.151:43276) CTCP(26) <-> TCP(75) <-> [RTSP(76)]/thelib/src/netio/epoll/tcpacceptor.cpp:127 ACCEPTING CONNECION!

/thelib/src/netio/epoll/iohandlermanager.cpp:119 Handlers count changed: 24->25 IOHT_TCP_CARRIER
/thelib/src/netio/epoll/tcpacceptor.cpp:195 Inbound connection accepted: (Far: 139.162.97.151:43276; Near: 139.162.97.151:5544) CTCP(29) <-> TCP(77) <-> [RTSP(78)]/thelib/src/netio/epoll/iohandlermanager.cpp:129 Handlers count changed: 25->24 IOHT_TCP_CONNECTOR
/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp:2627 Stream named live not found
/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp:657 URI analyzer failed
/thelib/src/protocols/rtp/rtspprotocol.cpp:397 Unable to handle content
/thelib/src/netio/epoll/tcpcarrier.cpp:91 Unable to read data from connection: (Far: 139.162.97.151:43276; Near: 139.162.97.151:5544) CTCP(29) <-> [TCP(77)] <-> RTSP(78). Signaling upper protocols failed
/thelib/src/netio/epoll/iohandlermanager.cpp:129 Handlers count changed: 24->23 IOHT_TCP_CARRIER
/thelib/src/application/baseclientapplication.cpp:398 Protocol [RTSP(78)] unregistered from application: evostreamms
/thelib/src/netio/epoll/tcpcarrier.cpp:84 Unable to read data from connection: (Far: 139.162.97.151:5544; Near: 139.162.97.151:43276) CTCP(26) <-> [TCP(75)] <-> RTSP(76). Error was (104): Connection reset by peer
/thelib/src/netio/epoll/iohandlermanager.cpp:129 Handlers count changed: 23->22 IOHT_TCP_CARRIER
/thelib/src/application/baseclientapplication.cpp:398 Protocol [RTSP(76)] unregistered from application: evostreamms
 
 
 

erika Evostream-Staff answered 2 years ago

Hi BillMalkin,
May I know how you add a stream in EMS? You said you add a stream using EMS Online? Do you mean Web UI? May I know the steps you did? 
The logs shows that “Stream named live not found”. The localstreamname you are calling is “live” and based on your config you used “myStream2”.
“defaults to port 554” –> this is the default transport layer of RTSP, no problem if EMS connects to this port. 🙂
Please let me know the steps you did.  You can also use the UI in adding streams please click here.
 
Thank you.
 

BillMalkin Member answered 2 years ago

Hi Erika
Yes, it was Web UI. (It has EMS ONLINE at the top of each page so I thought that would be a bit more specific. Not the case, I guess.) Specifically, I clicked on Streams on the menu on the left, then clicked on “+ Add”, then I left the inbound stream type to Inbound Live Stream (pull), set the URI Stream Source to rtsp://139.162.97.151:5544/live and set the localStreamName to myStream2.
In my Android app I’m using rtsp://139.162.97.151:5544/live/myStream2 as my streaming URL. For Wowza I used rtsp://139.162.97.151:1935/live/myStream2, but I believe for EvoStream this needed to be changed to either 554 or 5544. I changed it to 5544 as my port 554 is blocked.
> The logs shows that “Stream named live not found”. The localstreamname you are calling is “live” and based on your config you used “myStream2”.
Yes, this is confusing to me too.
a) If I use URI Stream Source = rtsp://139.162.97.151:5544/live, then the logs say “Stream named live not found”.
b) If I use URI Stream Source = rtsp://139.162.97.151:5544 then it says there is no stream name.
c) The logs never seem to mention the localStreamName that I have configured.
I am therefore guessing that, in my case, “live” is the external stream name and “myStream2” is the local stream name. Would that be correct?
> You can also use the UI in adding streams please click here.

Yes, I read that. It didn’t help much.
Thanks.

Cheers
Bill
 
 
 
 

erika Evostream-Staff answered 2 years ago

Hi Bill,
So you add this source:  “rtsp://139.162.97.151:5544/live” and you gave “myStream2” as the localStreamName.
You used “rtsp://139.162.97.151:5544/live/myStream2” for the playback.
As said to my previous answer, if you want to do playback using RTMP, please use this format: “rtmp://<EMS_IP>/live/Test".
Going back to your added stream, 
If you want to play using RTSP, please use:  rtsp://139.162.97.151:5544/myStream2
If you want to play using RTMP, please use:  rtmp://139.162.97.151/live/myStream2
You can also test play your stream using the UI, please click here.
 
Here is the reference on how to play pulled streams. Note that Add in UI is also the same with pullStream command. 
 
Hope this resolves the issue. 🙂
Thank you!

BillMalkin Member answered 2 years ago

Hi Erika
> So you add this source:  “rtsp://139.162.97.151:5544/live” and you gave “myStream2” as the localStreamName.
Yes. Is that the correct way to set it up?
> You used “rtsp://139.162.97.151:5544/live/myStream2” for the playback
No, I haven’t started talking about playback yet. I’m still talking specifically and exclusively about the push-in stream. The Android app pushes the stream into EMS.
Cheers
Bill

erika Evostream-Staff answered 2 years ago

Hi Bill,

So you add this source:  “rtsp://139.162.97.151:5544/live” and you gave “myStream2” as the localStreamName.
Yes. Is that the correct way to set it up?
A: Yes this is correct

 

You used “rtsp://139.162.97.151:5544/live/myStream2” for the playback
No, I haven’t started talking about playback yet. I’m still talking specifically and exclusively about the push-in stream. The Android app pushes the stream into EMS.
A: I see, so you will push the stream from your android app to EMS. Maybe this forum post helps. 

 
Thank you.
 

BillMalkin Member answered 2 years ago

Hi Erika
Thanks very much for your very quick responses! The post to which you gave me a link says that the Android phone needs to send an RTMP stream to EMS so it seems I can’t send an RTSP stream from my Android app to EMS after all. That’s pretty disappointing news after all the effort we’ve both gone through trying to make this work.
Thanks anyway.
Cheers
Bill

erika Evostream-Staff answered 2 years ago

Hi Bill,
EMS accepts RTSP. 
“In my Android app I’m using rtsp://139.162.97.151:5544/live/myStream2 as my streaming URL. ….”
Please use rtsp://139.162.97.151:5544/myStream2 (remove /live).
Please try also rtmp://139.162.97.151/live/myStream2.
If this doesn’t work, please send us the logs at salesupport@evostream.com
 
Thank you.
 

BillMalkin Member answered 2 years ago

Hi Erika
Just recapping. Once I changed over to my present hosting site I was quickly able to get past the problem with the licence verification and I very soon got an RTMP stream from my Android phone connecting to EMS, and then used FlowPlayer JS to view the stream very nicely on a web page. I was also able to do this using videojs. That was a week or so ago and I haven’t been able to achieve anything else since. I have spent a lot of time trying to do the following with no success:

  1. Sending an RTSP stream from my Android phone to EMS. It works well with Wowza but simply will not connect to EMS.
  2. Viewing streams using the EvoStream players. I can’t get them to work and there are errors in the JS console.
  3. Sending a stream to Facebook. It all seems to connect but nothing can be seen in Facebook.
  4. Sending a stream to YouTube. It seems to attempt to connect and then just hangs.
  5. I haven’t yet been able to view the stream using HTML5 rather than using a JS API that requires Flash.

I now think there must be something wrong with my new hosting site as I have many other problems also. For instance, I generally have to refresh pages in Web UI whenever I click on a Tab such as Config, Active Add, etc in the Streams section. Otherwise the tab body just does not appear. There are also dead links in the documentation. I’ve let you know about one but the others haven’t been so critical and I have too many other problems to worry about in any case.
Anyway, please close this ticket as, unless I can see what the problem is in my hosting site, I’m going to take a break from this. (In my forty years in IT I have investigated many products as a consultant but this one has me totally beat.)
Thanks very much for your patience.
Kind regards
Bill