UnityRenderStreaming
UnityRenderStreaming copied to clipboard
[BUG]: Webcam texture stream sent from macOS, iOS is extremely low resolution
Package version
3.1.0-exp.2
Environment
* OS: macOS, iOS
* Unity version: 2020.3.26
* Network: Local network connection
Steps To Reproduce
- Using
Bidirectionalsample scene, set up a server and connect using a key. - Set up same
Bidirectionalscene on a macOS device, with settings of connecting to the above server and run renderstream on Awake - Run scene, and enter in same key as in step 1.
- Click
Start Video/Micand immediately clickSetup.
Current Behavior
Texture received by device in step 1 is of extremely low resolution if step 4 was done quickly enough. This only occurs on macOS and iOS (Windows, Linux, Android are not affected).

Expected Behavior
Expected behaviour is that the texture image should be of the expected resolution.
Anything else?
I've identified the issue as occurring when SignalingHandlerBase.CreateConnection() (via SingleConnection here) is called before WebCamStreamSender's StartVideo() coroutine completes, specifically before WebCamStreamSender.m_webCamTexture.didUpdateThisFrame == true.
Could you try the latest version 3.1.0-exp.3?
@karasusan I've updated the bug report after isolating the general cause of the bug; it was a setup rather than encoding issue.
I created a fix for the sample (and my project's implementation) by converting BidirectionalSample.SetUp() to call a coroutine to create the connection:
private void SetUp()
{
setUpButton.interactable = false;
hangUpButton.interactable = true;
connectionIdInput.interactable = false;
StartCoroutine(MediaSetupBufferedConnection())
}
private IEnumerator MediaSetupBufferedConnection()
{
yield return new WaitUntil(() => webCamStreamer.SendTexture != null
&& ((WebCamTexture)webCamStreamer.SendTexture).didUpdateThisFrame);
yield return new WaitForSeconds(0.1f);
singleConnection.CreateConnection(connectionId);
}
I'll try upgrading and testing for its occurrence in 3.1.0-exp.3 when I have the time.
@Strowy Thanks for sharing detail and the great suggestion! We will fix the issue for next milestone.
memo: URS-430