...
Chrome | Firefox | Safari 11 | Edge | |
---|---|---|---|---|
Windows | + | + | + | |
Mac OS | + | + | + | |
Android | + | + | ||
iOSiPadOS | - | - | + |
Supported codecs
- Video: H.264
- Audio: AAC
...
1. For this test we use:
- the demo server at demo.flashphoner.com;
- the Two Way Streaming web application for publishing the stream
- the Player web application to play the stream via MSE
...
Code Block | ||||
---|---|---|---|---|
| ||||
stream = session.createStream(options).on(STREAM_STATUS.PENDING, function(stream) {
...
}).on(STREAM_STATUS.PLAYING, function(stream) {
...
}).on(STREAM_STATUS.STOPPED, function() {
setStatus(STREAM_STATUS.STOPPED);
onStopped();
}).on(STREAM_STATUS.FAILED, function(stream) {
...
}).on(STREAM_STATUS.NOT_ENOUGH_BANDWIDTH, function(stream){
...
});
stream.play(); |
MSE buffering
With a large number of subscribers playing MSE streams, server CPU load average increases. To prevent this, MSE frames buffering added sunce build 5.2.360. A frames count to be sent in one packet is defined with the following parameter in flashphoner.properties file
Code Block | ||
---|---|---|
| ||
avcc_buffer_wait_frames_count=5 |
By default, 5 frames are sent in one packet.
A buffer size for the frames to be sent can be set with the following parameter
Code Block | ||
---|---|---|
| ||
avcc_send_buffer_size=500000 |
By default, buffer size is 500 kbytes. If packet does not fit to the buffer, server will try to send it directly to the subscriber with the following message in server log
Code Block | ||
---|---|---|
| ||
12:00:50,555 ERROR AvccSendBuffer - VideoProcessor-db2da9a0-ddb6-11e9-9fc2-cf9284f3bdd0 Failed to buffer frame |
It is recommended to set more frames count per one packet and more buffer size to decrease CPU load average. Note that more buffering adds more playback delay.
Buffering can be disabled if necessary by changing the parameter msePacketizationVersion
in WebSDK source code
Code Block | ||||
---|---|---|---|---|
| ||||
wsConnection.onopen = function () {
onSessionStatusChange(SESSION_STATUS.CONNECTED);
cConfig = {
appKey: appKey,
mediaProviders: Object.keys(MediaProvider),
keepAlive: keepAlive,
authToken:authToken,
clientVersion: "0.5.28",
clientOSVersion: window.navigator.appVersion,
clientBrowserVersion: window.navigator.userAgent,
msePacketizationVersion: 2,
custom: options.custom
}; |
to
Code Block | ||||
---|---|---|---|---|
| ||||
msePacketizationVersion: 1, |
In this case buffering settings are not applied, frames will be sent directly to MSE-subscribers.
Known issues
1. When stream is published from Flash client with low framerate and played via MSE in MS Edge and Internet Explorer 11 browsers with mseCutByIFrameOnly=true setting and transcoding enabled, video freezes are possible.
Symptoms: when stream is published from Flash client and played in Player web appliucation with mseCutByIFrameOnly=true setting enabled and resolution explicitly set, for example https://server:8888/client2/examples/demo/streaming/player/player.html?resolution=320x240&mediaProvider=MSE&mseCutByIFrameOnly=true, freezes often occur in MS Edge or IE 11 browsers.
...
a) FPS must not be lower then 25 when stream is published from Flash client, trenscoding has also to be escaped;
бb) If FPS cannot be higher or transcoding is necessary, the following parameter in flashphoner.properties file should be reduced, for example
Code Block | ||||
---|---|---|---|---|
| ||||
video_encoder_h264_gop=30 |
2. MSE is not supported in iOS Safari on iPhone devices.
Symptoms: stream playback by MSE on iPhone device with iOS 12 and later is not started, in this case "None of preferred media providers available" message is displayed in Embed Player example
Soluition:
a) use WebRTC on iPhone device with iOS 12 and later
b) use WSPlayer or TURN сервер if one-port connection is needed
3. Two streams cannot be played simultaneously by MSE using the same Websocket connection on the same page
Symptoms: two streams cannot be played in 2Players example using main browsers (Chrome, Firefox, Safari) while connecting to WCS server via HTTP
Решение: use a separate Websocket connection for each stream on the same page while playing them by MSE