embed player stops stream after 7-8 minutes

chako

New Member
Hello ,
WCS version : 5.1.3
Server Config : 4 core CPU, 8GB RAM
I'm re transmitting RTSP stream over embed player,
my streams broadcasts perfectly but after 7-8 mins it stops playing from all users and shows FAILED then if they click on play, it again plays perfectly. i have only 6 viewers while broadcasting.
Logs and gc properties.
https://files.fm/u/zq5zzfy8
 

Max

Administrator
Staff member
In your server log we see that your RTSP source is disconnected because server did not received response on session refresh request. Try to set this parameter in WCS_HOME/conf/flashphoner.properties file
Code:
rtsp_refresh_requests_limit=5
This is the default value, try to increase it until your RTSP source stops disconnecting.
We look at your debug logs, may be it help us to find more elegant solution.
 

Max

Administrator
Staff member
As we see in your logs, your RTSP source does not response to any GET_PARAMETER or OPTIONS request after successful RTSP connection. Besides, your RTSP source uses the same port numbers for RTP and RTCP sessions.
So, the most elegant solution in your case is to change the RTSP source (IP camera device) to something more compatible with standard.
A practical way that some customers go is to modify Embed Player script WCS_HOME/client2/examples/demo/streaming/embed_player/player.js
to automatically reconnect to the RTSP stream when STREAM_STATUS.FAILED or STREAM_STATUS.STOPPED event is received, and the stream playback did not stopped manually. For example (pseudocode):
Code:
stream = session.createStream(options).on(STREAM_STATUS.PENDING, function(stream) {
       ...
    }).on(STREAM_STATUS.STOPPED, function () {
       ... 
       //try to restart
        if (!isManualStopped) {
            tryToRestart();
        }
    }).on(STREAM_STATUS.FAILED, function () {
        ...
        //try to restart
        tryToRestart();
   ...
});
stream.play();
 

chako

New Member
Thanks for the help
now i changed
rtsp_refresh_requests_limit=5 with
rtsp_refresh_requests_limit=10
so stream duration increased 7 mins to 10 mins but that didnt helped so
I used your pseudo code and added start method in WCS_HOME/client2/examples/demo/streaming/embed_player/player.js
but now i'm facing a small issue that my stream stops after 10 mins and after couple of second the start method starts the stream
kindly suggest me some workaround so i can play uninterrupted stream on my players
 

Max

Administrator
Staff member
You can increase sesssion refresh request limit much more, such as
rtsp_refresh_requests_limit=1000
but the stream just will be interrupted less often. To play uninterrupted stream you have to change the RTSP source (IP camera device) to something more compatible with standard.
 

gush.chang

New Member
I am looking for a player supporting both RTMP/RTSP streaming.
If the source stream switches from RTSP to RTMP, the embedded player still works right ?
I can customized some behaviors once events happened (like automatically reconnecting to the RTMP/RTSP stream when STREAM_STATUS.FAILED or STREAM_STATUS.STOPPED)
 

Max

Administrator
Staff member
Hello.
If the source stream switches from RTSP to RTMP, the embedded player still works right ?
Yes, it should work, you should only change the stream URL from rtsp://stream_url to rtmp://stream_url
I can customized some behaviors once events happened
Yes, you can.
The Player example is described in details on this page.
For futher questions, please create a new topic on this forum.
 
Top