WebRTC, WSPlayer automatic stop playing stream every minute

warinthorn_s

New Member
We have issue when playing WebRTC,WSPlayer player in embed player demo for around 1-2 minutes, the playing stream always report status disconnected or failed.

Additional Information
1. WebCallServer version 5.2.591 (Upgrade yesterday)
2. OBS newest version is broadcaster and stream as rtmp://
2.1. No disconnected message on flashphoner and already add "keep_alive.enabled=websocket,rtmfp" to flashphoner.properties

Do you have any advise?
 

pichai_c

New Member
I've the same issue, after try replay the stream in embed player for 10 times I've found that it's will play for 118-120 seconds and it's automatic stop by itself.
 

Max

Administrator
Staff member
We received and checked the report.
Seems like your are publishing high profile/resolution RTMP stream (there are messages It's B-frame! in cleint debug logs), and playing it with WSPlayer.
Please try to use lower publishing resolution (640x480 for example) with ultrafast preset to escape B-frames.
Also, all the clients sop playback by disconnectiong with the following message:
Code:
08:56:20,738 WARN       WSServerHandler - pool-23-thread-1 Close channel [id: 0x31f22aa4, ... because: org.jboss.netty.handler.timeout.ReadTimeoutException 'null'
This means that players channel is probably poor to play 640x480 stream via websocket connection (which used to play stream by WSPlayer).
Please also note that WSPlayer technology is intended to use with legacy iOS devices only (iOS before 11) and mandatory uses transcoding to reencode stream to MPV for video and PCMU for audio. So it should not be used with the most of client browsers.
So we recommend:
1. To use WebRTC instead of WSPlayer to play the stream
2. To lower stream resolution/bitrate to 240p/200 kbps for example, for subscribers channels to be enough to play the stream.
 

pichai_c

New Member
We received and checked the report.
Seems like your are publishing high profile/resolution RTMP stream (there are messages It's B-frame! in cleint debug logs), and playing it with WSPlayer.
Please try to use lower publishing resolution (640x480 for example) with ultrafast preset to escape B-frames.
Also, all the clients sop playback by disconnectiong with the following message:
Code:
08:56:20,738 WARN       WSServerHandler - pool-23-thread-1 Close channel [id: 0x31f22aa4, ... because: org.jboss.netty.handler.timeout.ReadTimeoutException 'null'
Max, thank you for quick response and good support

We publish stream with resolution 640x480 to flashphoner server and the issue show for all players (we have around 200 players play in the working hour). For the provided log we are publishing high resolution RTMP stream for testing and logging for you only.

Anyways now this issue resolved after we've modify flashphoner.properties by change from
Code:
keep_alive.algorithm=NONE
to
Code:
keep_alive.algorithm=HIGH_LEVEL
Could you please explain how it's work after change the keep_alive.algorithm?



This means that players channel is probably poor to play 640x480 stream via websocket connection (which used to play stream by WSPlayer).
Please also note that WSPlayer technology is intended to use with legacy iOS devices only (iOS before 11) and mandatory uses transcoding to reencode stream to MPV for video and PCMU for audio. So it should not be used with the most of client browsers.
So we recommend:
1. To use WebRTC instead of WSPlayer to play the stream
2. To lower stream resolution/bitrate to 240p/200 kbps for example, for subscribers channels to be enough to play the stream.
Thank you for your recommendation
 

pichai_c

New Member
Max, we've another question about your recommendation.

We've change to WebRTC player as your recommendation, the video play without sound in Android device (Webview), but it's work fine in iOS device (Webview)
 

Max

Administrator
Staff member
Good day.
Could you please explain how it's work after change the keep_alive.algorithm?
The keep_alive.algorithm parameter affects all the publishing and playback technologies, so it is not recommended to disable it. But, keep alive sending can be disabled for certain protocol. For example, keep alive should be disabled when RTMP stream is published from OBS:
Code:
keep_alive.enabled=websocket,rtmfp
We've change to WebRTC player as your recommendation, the video play without sound in Android device (Webview), but it's work fine in iOS device (Webview)
It is probably Webview codec support problem. Please check if video is playing with sound in Chrome browser on that Android device. Also please collect client debug logs again for this case (playing the stream as WebRTC in Android Webview) and send us, we will check.
 

pichai_c

New Member
Thank you Max,

It is probably Webview codec support problem. Please check if video is playing with sound in Chrome browser on that Android device. Also please collect client debug logs again for this case (playing the stream as WebRTC in Android Webview) and send us, we will check.
I've test playing in Android Google Chrome browser the video playing with sound properly.

I'll collect the debug logs on chrome webview in my application to you for investigate after hour business hour (9-18 UTC+7)
 

Max

Administrator
Staff member
Good day.
We checked your logs, audio packets flow normally from server to Android device, so it is not a codecs problem. Seems like some user actions required on WebView side to play video with sound. Please read this StackOverflow topic. At least, try to add to Webview object settings
Code:
settings.setMediaPlaybackRequiresUserGesture(false);
Also, you can set Webview User Agent to desktop browser.
 
Top