membrane_rtc_engine icon indicating copy to clipboard operation
membrane_rtc_engine copied to clipboard

Sometimes simulcast doesn't properly switch encoding

Open Rados13 opened this issue 2 years ago • 0 comments

During work on #134 I met with strange behavior that sometimes even though we peer received callback that encoding switched, the width and height of incoming frames doesn't change. The SSRC in SimulcastTee changes correctly, after a change of encoding. In addition in this situation, WebRTC Stats API doesn't show any qualityLimitationReason.

Example logs from the failed test:

test User disable and then enable medium encoding (TestVideoroom.Integration.SimulcastTest)
     test/integration/simulcast_test.exs:27
     Failed on stage: disable should be encoding: h,
                     receiver stats are: [%{"callbackEncoding" => "m", "framesPerSecond" => 19, "framesReceived" => 356, "height" => 360, "width" => 640}, %{"callbackEncoding" => "m", "framesPerSecond" => 12, "framesReceived" => 389, "height" => 360, "width" => 640}, %{"callbackEncoding" => "h", "framesPerSecond" => 15, "framesReceived" => 404, "height" => 360, "width" => 640}, %{"callbackEncoding" => "h", "framesPerSecond" => 20, "framesReceived" => 441, "height" => 360, "width" => 640}, %{"callbackEncoding" => "h", "framesPerSecond" => 20, "framesReceived" => 481, "height" => 360, "width" => 640}, %{"callbackEncoding" => "h", "framesPerSecond" => 15, "framesReceived" => 519, "height" => 360, "width" => 640}, %{"callbackEncoding" => "h", "framesPerSecond" => 20, "framesReceived" => 559, "height" => 360, "width" => 640}, %{"callbackEncoding" => "h", "framesPerSecond" => 20, "framesReceived" => 595, "height" => 360, "width" => 640}, %{"callbackEncoding" => "h", "framesPerSecond" => 15, "framesReceived" => 632, "height" => 360, "width" => 640}, %{"callbackEncoding" => "h", "framesPerSecond" => 19, "framesReceived" => 674, "height" => 360, "width" => 640}, %{"callbackEncoding" => "h", "framesPerSecond" => 20, "framesReceived" => 710, "height" => 360, "width" => 640}, %{"callbackEncoding" => "h", "framesPerSecond" => 17, "framesReceived" => 747, "height" => 360, "width" => 640}]
                     sender stats are: [%{"h" => %{"framesPerSecond" => 20, "framesSent" => 279, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 20, "framesSent" => 279, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 20, "framesSent" => 279, "height" => 360, "qualityLimitationReason" => "none", "width" => 640}}, %{"h" => %{"framesPerSecond" => 20, "framesSent" => 321, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 20, "framesSent" => 321, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 19, "framesSent" => 320, "height" => 360, "qualityLimitationReason" => "none", "width" => 640}}, %{"h" => %{"framesPerSecond" => 21, "framesSent" => 362, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 21, "framesSent" => 362, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 0, "framesSent" => 320, "height" => 360, "qualityLimitationReason" => "none", "width" => 640}}, %{"h" => %{"framesPerSecond" => 20, "framesSent" => 401, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 20, "framesSent" => 401, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 0, "framesSent" => 320, "height" => 360, "qualityLimitationReason" => "none", "width" => 640}}, %{"h" => %{"framesPerSecond" => 20, "framesSent" => 442, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 20, "framesSent" => 442, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 0, "framesSent" => 320, "qualityLimitationReason" => "none"}}, %{"h" => %{"framesPerSecond" => 20, "framesSent" => 482, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 20, "framesSent" => 482, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 0, "framesSent" => 320, "qualityLimitationReason" => "none"}}, %{"h" => %{"framesPerSecond" => 20, "framesSent" => 522, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 20, "framesSent" => 522, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 0, "framesSent" => 320, "qualityLimitationReason" => "none"}}, %{"h" => %{"framesPerSecond" => 21, "framesSent" => 563, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 21, "framesSent" => 563, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 0, "framesSent" => 320, "qualityLimitationReason" => "none"}}, %{"h" => %{"framesPerSecond" => 20, "framesSent" => 603, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 20, "framesSent" => 603, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 0, "framesSent" => 320, "qualityLimitationReason" => "none"}}, %{"h" => %{"framesPerSecond" => 21, "framesSent" => 644, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 21, "framesSent" => 644, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 0, "framesSent" => 320, "qualityLimitationReason" => "none"}}, %{"h" => %{"framesPerSecond" => 20, "framesSent" => 683, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 20, "framesSent" => 683, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 0, "framesSent" => 320, "qualityLimitationReason" => "none"}}, %{"h" => %{"framesPerSecond" => 20, "framesSent" => 724, "height" => 720, "qualityLimitationReason" => "none", "width" => 1280}, "l" => %{"framesPerSecond" => 20, "framesSent" => 724, "height" => 180, "qualityLimitationReason" => "none", "width" => 320}, "m" => %{"framesPerSecond" => 0, "framesSent" => 320, "qualityLimitationReason" => "none"}}]
       

Rados13 avatar Jul 01 '22 11:07 Rados13