Stream become blurred after mixer

paulliu

New Member
Hello !

The WCS version i use is 5.2.1162-1f782af1e3f8c26cc4dff6193968369317f1f560

Currently i am working on mix multiple streams by using automatically create mixer with stream name e.g., {user}#{room}#{type}

if i play the stream(user1#room1#desktop) directly the video quality looks pretty good !

but when play the mixer stream(room1) the quality just become blurred

flashphoner.properties setting
Code:
webrtc_cc_min_bitrate = 3000000
webrtc_cc_max_bitrate = 10000000

encoder_priority=OPENH264
video_encoder_max_threads=4
mixer_video_bitrate_kbps=6000
mixer_show_separate_audio_frame=false
mixer_video_desktop_layout_padding=10
mixer_video_grid_layout_padding=10
mixer_video_layout_desktop_key_word=desktop
mixer_desktop_align=LEFT
mixer_voice_activity=false

mixer_out_buffer_enabled=true
mixer_out_buffer_start_size=300
mixer_out_buffer_polling_time=300

I also tried add lossless settings but looks help nothing,

Code:
mixer_lossless_video_processor_enabled=true
mixer_lossless_video_processor_max_mixer_buffer_size_ms=200
mixer_lossless_video_processor_wait_time_ms=20
and i also found if i turn on the mixer_lossless_video_processor_enabled,

the single stream playing will not work anymore, i not sure it's a feature or a bug ?

Thanks !!!!!!
 

Attachments

Max

Administrator
Staff member
Good day.
Plerase clarify, what server hardware configuration do you use and how much memory you allocate for Java heap?
Mixer decodes all incoming streams and encodes outgoing stream, so it requires a lot of CPU. We recommend at least 2 CPU cores per one mixer plus at least 2 CPU cores for other server tasks. Please read this article about mixer load testing: How many mixers can a server have?
Java heap size should be set at half of servers RAM. For example, if server RAM is 32 Gb, then it is recommended to allocate 16 Gb with the following settings in wcs-core.properties file:
Code:
-Xmx16g
-Xms16g
Make sure also that channel bandwidth is good enough to play and publish 1080p and higher streams (at least 20 Mbps up and 20 Mbps down). You can use iperf to test a channel.
About losless setiings. This is legacy, it does not work in realtime and strongly not recommended.
 

paulliu

New Member
Hi Max,

Appreciate your response !

The server has 4vCPUs and 16GB memory

I also did the heap setting before

Code:
### JVM OPTIONS ###
-Xms8G
-Xmx16G
should i adjust it?

iperf test
Code:
Connecting to host *, port 33000
[  8] local 192.168.1.4 port 57965 connected to * port 33000
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  8]   0.00-1.00   sec   129 KBytes  1.06 Mbits/sec  94 
[  8]   1.00-2.00   sec   128 KBytes  1.05 Mbits/sec  93 
[  8]   2.00-3.00   sec   128 KBytes  1.05 Mbits/sec  93 
[  8]   3.00-4.00   sec   128 KBytes  1.05 Mbits/sec  93 
[  8]   4.00-5.00   sec   128 KBytes  1.05 Mbits/sec  93 
[  8]   5.00-6.00   sec   128 KBytes  1.05 Mbits/sec  93 
[  8]   6.00-7.00   sec   128 KBytes  1.05 Mbits/sec  93 
[  8]   7.00-8.00   sec   128 KBytes  1.05 Mbits/sec  93 
[  8]   8.00-9.00   sec   128 KBytes  1.05 Mbits/sec  93 
[  8]   9.00-10.00  sec   128 KBytes  1.05 Mbits/sec  93 
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  8]   0.00-10.00  sec  1.25 MBytes  1.05 Mbits/sec  0.000 ms  0/931 (0%)  sender
[  8]   0.00-10.00  sec  1.25 MBytes  1.05 Mbits/sec  0.342 ms  0/931 (0%)  receiver

Connecting to host *, port 33000
Reverse mode, remote host * is sending
[  8] local 192.168.1.4 port 54012 connected to * port 33000
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  8]   0.00-1.00   sec   116 KBytes   946 Kbits/sec  0.251 ms  0/84 (0%) 
[  8]   1.00-2.00   sec   131 KBytes  1.07 Mbits/sec  0.244 ms  0/95 (0%) 
[  8]   2.00-3.00   sec   126 KBytes  1.04 Mbits/sec  0.233 ms  0/92 (0%) 
[  8]   3.00-4.00   sec   129 KBytes  1.06 Mbits/sec  0.474 ms  0/94 (0%) 
[  8]   4.00-5.00   sec   126 KBytes  1.03 Mbits/sec  0.181 ms  0/92 (0%) 
[  8]   5.00-6.00   sec   132 KBytes  1.09 Mbits/sec  0.263 ms  0/96 (0%) 
[  8]   6.00-7.00   sec   124 KBytes  1.01 Mbits/sec  0.238 ms  0/90 (0%) 
[  8]   7.00-8.00   sec   128 KBytes  1.05 Mbits/sec  0.498 ms  0/93 (0%) 
[  8]   8.00-9.00   sec   129 KBytes  1.06 Mbits/sec  1.463 ms  0/94 (0%) 
[  8]   9.00-10.00  sec   129 KBytes  1.06 Mbits/sec  0.400 ms  0/94 (0%) 
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  8]   0.00-10.00  sec  1.25 MBytes  1.05 Mbits/sec  0.000 ms  0/924 (0%)  sender
[  8]   0.00-10.00  sec  1.24 MBytes  1.04 Mbits/sec  0.400 ms  0/924 (0%)  receiver
the testing result seems bad, i think i found the bottleneck

thanks so much !!
 

paulliu

New Member
Hi Max,

if i run iperf3 with TCP mode and the bandwidth looks fine

Code:
Connecting to host *, port 33000
[  8] local 192.168.1.4 port 57132 connected to * port 33000
[ ID] Interval           Transfer     Bitrate
[  8]   0.00-1.00   sec  6.32 MBytes  52.8 Mbits/sec                 
[  8]   1.00-2.00   sec  0.00 Bytes  0.00 bits/sec                 
[  8]   2.00-3.00   sec  1.03 MBytes  8.67 Mbits/sec                 
[  8]   3.00-4.00   sec  5.33 MBytes  44.8 Mbits/sec                 
[  8]   4.00-5.00   sec  5.47 MBytes  45.8 Mbits/sec                 
[  8]   5.00-6.00   sec  5.44 MBytes  45.7 Mbits/sec                 
[  8]   6.00-7.00   sec  5.34 MBytes  44.8 Mbits/sec                 
[  8]   7.00-8.00   sec  5.45 MBytes  45.7 Mbits/sec                 
[  8]   8.00-9.00   sec  5.36 MBytes  45.0 Mbits/sec                 
[  8]   9.00-10.00  sec  5.33 MBytes  44.7 Mbits/sec                 
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  8]   0.00-10.00  sec  45.1 MBytes  37.8 Mbits/sec                  sender
[  8]   0.00-10.00  sec  44.1 MBytes  37.0 Mbits/sec                  receiver

iperf Done.

Connecting to host *, port 33000
Reverse mode, remote host * is sending
[  8] local 192.168.1.4 port 57136 connected to * port 33000
[ ID] Interval           Transfer     Bitrate
[  8]   0.00-1.00   sec  6.26 MBytes  52.5 Mbits/sec                 
[  8]   1.00-2.00   sec  6.59 MBytes  55.3 Mbits/sec                 
[  8]   2.00-3.00   sec  6.83 MBytes  57.3 Mbits/sec                 
[  8]   3.00-4.00   sec  6.86 MBytes  57.6 Mbits/sec                 
[  8]   4.00-5.00   sec  6.98 MBytes  58.5 Mbits/sec                 
[  8]   5.00-6.00   sec  6.50 MBytes  54.5 Mbits/sec                 
[  8]   6.00-7.00   sec  6.92 MBytes  58.1 Mbits/sec                 
[  8]   7.00-8.00   sec  6.67 MBytes  55.9 Mbits/sec                 
[  8]   8.00-9.00   sec  6.67 MBytes  55.9 Mbits/sec                 
[  8]   9.00-10.00  sec  6.72 MBytes  56.4 Mbits/sec                 
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  8]   0.00-10.00  sec  70.5 MBytes  59.1 Mbits/sec   96             sender
[  8]   0.00-10.00  sec  67.0 MBytes  56.2 Mbits/sec                  receiver

iperf Done.
any suggestion ?

thanks !
 

Max

Administrator
Staff member
The server has 4vCPUs and 16GB memory
I also did the heap setting before
-Xms8G
-Xmx16G
First, use 8 vCPU (m5.2xlarge for example). Do not use shared CPU because this may affect performance.
Also, do not allocate all the server RAM for Java heap memory: a much data are stored in native (system) memory during transcoding. For 16 G RAM, the settings should be
Code:
-Xms8G
-Xmx16G
the testing result seems bad, i think i found the bottleneck
iperf cannot measure UDP bandwidth correctly, so TCP test shows more reliable result.
You can use TCP transport to play a stream to prevent packet loss:
Code:
session.createStream({
    name: streamName,
    display: remoteVideo,
    transport: "TCP"
}).on(STREAM_STATUS.PENDING, function (stream) {
...
}).play();
 
Top