FME Re-establishing failed

phil

New Member
Hello Max,

I currently have two issues:
1. What happens to WCS when the connection between FME and WCS is disconnected. I'm getting this issue when it happens. FME tries to re-establish, but it doesn't help much.

upload_2017-2-22_15-47-27.png


2. I used rtsp connection to make a load balancing architecture. However, when the connection goes down to zero, the connection is not released.
upload_2017-2-22_15-51-57.png
 

Max

Administrator
Staff member
1. What happens to WCS when the connection between FME and WCS is disconnected.
On publisher disconnect, WCS should terminate the published stream and all subscribers of this stream.
If the publisher has lost network connection, it may take some time to terminate the connection by keep alive.
It was fixed from build 2075. RTMP connections were not released in older builds.
Keep alive settings are located in:
Code:
server.properties
You can edit these properties:
Code:
keep_alive.algorithm       =INTERNAL
keep_alive.server_interval =5000
keep_alive.probes          =10
For example if you set
Code:
keep_alive.server_interval =2000
keep_alive.probes =1
Then connection will be released in 2 seconds on first unsuccessful keep alive request.
 

Max

Administrator
Staff member
I used rtsp connection to make a load balancing architecture. However, when the connection goes down to zero, the connection is not released.
Outgoing RTSP connection will be dropped once your edge WCS server is disconnected.
Your edge WCS server will close its client RTSP connection once no viewers connected to this RTSP URL.
You can terminate RTSP agent via REST API using commands:
Find all RTSP agents:
Code:
http://host:9091/RESTCall/findAllRtspAgents
{}
Shutdown agent by URI
Code:
http://host:9091/RESTCall/shutdownRtspAgent
{"uri":"rtsp://wcs-orign/stream1"}
 

Max

Administrator
Staff member
Regarding load balancing architecture,
In latest versions you can use RTMP re-streaming for loadbalancing.
For example, if you publish a stream to WCS1-orign, you can re-stream this as RTMP to WCS2-edge.
To do that you have to insert filed 'rtmpUrl' into Stream object.
Example for Web SDK:
Code:
session.createStream({name:'stream1',rtmpUrl:'rtmp://WCS2-edge:1935/live'});
As a result, stream1 will be re-published to server WCS2-edge as H.264 + AAC (these two codecs are supported for re-publishing) and can be payed from rtmp://WCS2-edge:1935/live/stream1
You can not do that from ffmpeg or from FMLE because they do not use 'createStream' over our API.
However you can return field rtmpUrl on the publish REST hook, and then it should be applied and your stream should be forwarded to WCS2-edge. Though we have not test this yet.
You can read more here about RTMP re-publishing: https://flashphoner.com/webrtc-as-rtmp-re-publishing
 

phil

New Member
Regarding load balancing architecture,
In latest versions you can use RTMP re-streaming for loadbalancing.
For example, if you publish a stream to WCS1-orign, you can re-stream this as RTMP to WCS2-edge.
To do that you have to insert filed 'rtmpUrl' into Stream object.
Example for Web SDK:
Code:
session.createStream({name:'stream1',rtmpUrl:'rtmp://WCS2-edge:1935/live'});
As a result, stream1 will be re-published to server WCS2-edge as H.264 + AAC (these two codecs are supported for re-publishing) and can be payed from rtmp://WCS2-edge:1935/live/stream1
You can not do that from ffmpeg or from FMLE because they do not use 'createStream' over our API.
However you can return field rtmpUrl on the publish REST hook, and then it should be applied and your stream should be forwarded to WCS2-edge. Though we have not test this yet.
You can read more here about RTMP re-publishing: https://flashphoner.com/webrtc-as-rtmp-re-publishing
Thanks Max, I'm very excited because this solution looks doable. Is there any linux commands I can use to push RTMP streams ?
 

Max

Administrator
Staff member
Currently we don't have API that starts pushing by external command. However we plan to implement this in the nearest future.
We plan to provide REST API for re-publishing a particular stream.
For example
Code:
http://host:9091/RESTStream/startRePublishing
{
"name":"stream1",
"pushName":"stream1_1",
"rtmpUrl":"rtmp://wcs2:1935/live"
}

http://host:9091/RESTStream/startRePublishing
{
"name":"stream1",
"pushName":"stream1_2",
"rtmpUrl":"rtmp://wcs2:1935/live"
}

http://host:9091/RESTStream/stopRePublishing
{
"name":"stream1",
"pushName":"stream1_1",
"rtmpUrl":"rtmp://wcs2:1935/live"
}

http://host:9091/RESTStream/stopRePublishing
{
"name":"stream1",
"pushName":"stream1_2",
"rtmpUrl":"rtmp://wcs2:1935/live"
}
 

phil

New Member
Currently we don't have API that starts pushing by external command. However we plan to implement this in the nearest future.
We plan to provide REST API for re-publishing a particular stream.
For example
Code:
http://host:9091/RESTStream/startRePublishing
{
"name":"stream1",
"pushName":"stream1_1",
"rtmpUrl":"rtmp://wcs2:1935/live"
}

http://host:9091/RESTStream/startRePublishing
{
"name":"stream1",
"pushName":"stream1_2",
"rtmpUrl":"rtmp://wcs2:1935/live"
}

http://host:9091/RESTStream/stopRePublishing
{
"name":"stream1",
"pushName":"stream1_1",
"rtmpUrl":"rtmp://wcs2:1935/live"
}

http://host:9091/RESTStream/stopRePublishing
{
"name":"stream1",
"pushName":"stream1_2",
"rtmpUrl":"rtmp://wcs2:1935/live"
}

Thank you Max. As of now, what is the simplest way of doing this RTMP pushing ?
 

Max

Administrator
Staff member
I'd like to make it republish streams received.
We plan to implement such type of re-publishing soon. I will keep you informed over this thread.
 
Top