UnityRenderStreaming icon indicating copy to clipboard operation
UnityRenderStreaming copied to clipboard

[REQUEST] Control RenderStreaming Resolution and Frame Rate

Open xavierpuigf opened this issue 4 years ago • 10 comments

It would be great to be able to control the RenderStreaming resolution and frame rate to adapt to different bandwidth conditions. I noticed CameraSteamer.cs has a streamingSize attribute to change the resolution of streaming, but it seems like this attribute is private, and therefore cannot be modified via code. There does not seem to be an attribute to control the frame rate.

xavierpuigf avatar Jun 22 '21 15:06 xavierpuigf

I got it. Thanks for your feedback

karasusan avatar Jun 23 '21 00:06 karasusan

Thank you! Is there a way to control currently the streaming frame rate? I see the streamSize variable to control the resolution but I wonder if there is any hidden variable that can help control the rate.

xavierpuigf avatar Jun 23 '21 18:06 xavierpuigf

WebRTC package has an API to control the bitrate. https://docs.unity3d.com/Packages/[email protected]/api/Unity.WebRTC.RTCRtpSender.html#Unity_WebRTC_RTCRtpSender_SetParameters_Unity_WebRTC_RTCRtpSendParameters_

Currently, Unity Render Streaming doesn't provide the API, so users need to custom the package.

karasusan avatar Jun 24 '21 09:06 karasusan

If you are still looking for information on this I made a forum post where I shared some code on how to use streamingSize and how to change video parameters (bitrate, downscale resolution, ...)

pilzinho avatar Jul 22 '21 12:07 pilzinho

memo: URS-330

karasusan avatar Nov 09 '21 02:11 karasusan

(I'm not sure if my question relates to this ticket, just let me know if I need to update it)

@karasusan Is there a way to render the camera viewport based on the size of the connected device? For example, when I connect to the webserver with my mobile phone, I want to display the video player in fullscreen, instead of 16:9 as the current camera within Unity app, the same with other devices such as desktop or tablet.

Thanks,

teexiii avatar Nov 30 '21 10:11 teexiii

@teexiii Are you saying that changing size of camera viewport on the sender side according to the size of receiver?

karasusan avatar Dec 01 '21 01:12 karasusan

@teexiii Are you saying that changing size of camera viewport on the sender side according to the size of receiver?

I believe it's correct @karasusan

mrgoonie avatar Dec 01 '21 03:12 mrgoonie

@mrgoonie @teexiii

It might be useful but there is no plan to support that at the moment.

This user posted the same issue in this thread. https://forum.unity.com/threads/resize-videostreamtrack-and-replacetrack-framerate-drops.1145414/

karasusan avatar Dec 01 '21 23:12 karasusan

The original issue relates on them. https://github.com/Unity-Technologies/UnityRenderStreaming/issues/453 https://github.com/Unity-Technologies/UnityRenderStreaming/issues/446 https://github.com/Unity-Technologies/UnityRenderStreaming/issues/611

karasusan avatar Dec 14 '21 03:12 karasusan