UnityRenderStreaming icon indicating copy to clipboard operation
UnityRenderStreaming copied to clipboard

[BUG] No setting RTCtpEncodingParameters

Open hbrucex opened this issue 4 years ago • 4 comments

it's unuseful when i use 'ChangeVideoParameters' method. because the length of 'sender.GetParameters()'.

How can i set RTCRtpSendParameters?

hbrucex avatar Mar 23 '21 08:03 hbrucex

We have similar requests so will work on it in near future. https://github.com/Unity-Technologies/UnityRenderStreaming/issues/450

karasusan avatar Mar 23 '21 09:03 karasusan

thank you

hbrucex avatar Mar 25 '21 03:03 hbrucex

If you are still trying to get this to work I made a forum post where I shared some code changes I made. Also how to use ChangeVideoParameters. The problem for me was that the parameters are not immediately available and therefore the array is empty. I just added a small delay before setting the parameters after the new sender was created and set. Something like this:

cameraStreamer.OnStartedStream += id => { StartCoroutine(HandleStreamStarted(cameraStreamer, id)); };

and

private IEnumerator HandleStreamStarted(CameraStreamer cameraStreamer, string connectionId)
{
        // The parameters are not available right away so wait for them
        yield return new WaitForEndOfFrame();
        Debug.Log($"WebRTC stream connected: {cameraStreamer.name} has {cameraStreamer.Senders.Count} active connections");
        cameraStreamer.ChangeVideoParameters(connectionId, maxBitrate, encodingFps);
}

pilzinho avatar Jul 22 '21 12:07 pilzinho

memo: URS-330

karasusan avatar Nov 09 '21 02:11 karasusan