UnityRenderStreaming
UnityRenderStreaming copied to clipboard
Poor Video Quality (using Nvidia T4)
I'm hosting the render streaming server at Google Cloud Instance (8vCpu & 8GB ram) having Nvidia T4 as its GPU. When accessed the ip to view render streaming it appears mosaic/pixelated . It appears to be on poor quality. But sometimes when stayed still without making any movement the video quality will improvise and sometimes not. It appears to be dynamically the quality is being adjusted to deliver the frames.
-I've tried switching resolutions on render camera in unity to 720p & 1080 but the result appear to be same -I've checked the resource usage on GCE. Only 30% of cpu, ram and GPU were used to stream the videos. So there is still lot of space to utilize to render high quality streams but it isnt doing
- I've checked the Bandwidth on my GCE. Its 1Gbps
-How can I improvise the render streaming video quality ?| -Is there a way to set the video codec formats to be delivered in Unity Webrtc ?
Attached the screenshots of the render video streams being received.
How about ChangeVideoParameters method?
https://docs.unity3d.com/Packages/[email protected]/api/Unity.RenderStreaming.VideoStreamBase.html
You can use webrtc-internal on Google Chrome for checking the bandwidth.
How about
ChangeVideoParametersmethod? https://docs.unity3d.com/Packages/[email protected]/api/Unity.RenderStreaming.VideoStreamBase.htmlYou can use webrtc-internal on Google Chrome for checking the bandwidth.
I cant edit the CameraStreamer.cs. RenderStreaming.cs or Broadcast.cs scripts as they are part of package (My changes are being reverted). Can I get a sample script from you that which can call the "ChangeVideoParameters" function you specified ?
I guess that this is the same issue. Could you try the VP8 codec? https://github.com/Unity-Technologies/com.unity.webrtc/issues/205
Can we use vp8 with hardware encoder ? Because, I want to fully use the GPU & reduce load on CPU
I guess that this is the same issue. Could you try the VP8 codec? Unity-Technologies/com.unity.webrtc#205
@h-rlpl
Can we use vp8 with hardware encoder ? Because, I want to fully use the GPU & reduce load on CPU
Unfortunately, no it can not.
Alright, Will be looking forward for HW Encoding feature :). I hope that resolves this issue Thank you
2.3.0 and lower allowed you to change the bandwidth. I hope they add this feature back into 3.0 as it has a more reliable web connection (in older versions you'd sometimes have to refresh the sample webpage in order to see the stream).
ChangeVideoParameters
FYI, I made a local copy of the unity render streaming plugin to edit the source in 3.0.1, and was able to call ChangeVideoParameters on the video streaming object after the on connect call. Significant bandwith improvements by increasing the max bitrate. I think we're still limited by h.264 as far as crispness goes. Most of the buggy artifacts were gone, and busy scenes look really decent, but a smooth gradient in a skybox will show bands and i don't think theres really a way around that right now.
Related issue https://github.com/Unity-Technologies/UnityRenderStreaming/issues/453
@LucasMoskun Can you give some insight as to where exactly you're calling ChangeVideoParameters? I'm having trouble pinpointing where exactly I should call it.
@LucasMoskun Can you give some insight as to where exactly you're calling ChangeVideoParameters? I'm having trouble pinpointing where exactly I should call it.
I went to look back and it looks like I accidently bombed my local repo without pushing the final commit :-/
I'm taking a look to see now, the most important thing is creating a local copy of the plugin so changes don't get overwritten.
Try creating the parameters you want, and passing them into a ChangeVideoParameters call in the CreateTrack function of CameraStreamer.cs. If that doesn't work look at OnFoundConnection function in SingleConnection.cs where the track is returned. You should be able to tell if it's a video track and cast it to VideoStreamBase and make the ChangeVideoParameters call on that.
If I remember correctly, until the connection is made, the parameters that are retrieved from the sender.GetParameters() function call will be empty, so it will skip over the setting portion. I think this was the big gotcha
public void ChangeVideoParameters(string connectionId, ulong? bitrate, uint? framerate) { if (!Senders.TryGetValue(connectionId, out var sender)) return; RTCRtpSendParameters parameters = sender.GetParameters(); foreach (var encoding in parameters.encodings) ....
Please let me know if that helps (Seriously :-) I may have to come back and use this again... kicking myself for losing the changes.)
My memory is that these changes did nothing at all in 2.x so I think this is a red herring. You probably haven't actually changed anything.
My memory is that these changes did nothing at all in 2.x so I think this is a red herring. You probably haven't actually changed anything.
I was using version 3.0.1. It worked. I recorded a bitrate increase from 1.3 Mbps to over 7.5 Mbps. Obvious increase in visual fidelity comparable to h.264 HVENC NDI streaming. There were definitely some gotchas and had to create a local copy of the plugin to modify the source, but at the end of the day that was the function that made it happen.
@LucasMoskun Why do you need to edit the codebase in order to call the ChangeVideoParameters function? It's public. I'm trying to get it to work, the only thing I'm missing is, how do I get the connectionId that I need to pass?
If someone is still trying to get ChangeVideoParameters to work in the newest version have a look at my answer in #453 if it works for you
memo: URS-330
We are working on these issue to fix it now. https://github.com/Unity-Technologies/com.unity.webrtc/issues/205 https://github.com/Unity-Technologies/com.unity.webrtc/issues/180
Recently I have been working on Unity render streaming with oculus quest 2, its working and running up but the video render quality is not that good, I have been trying to modify all the version of the WebRTC package and tried with the hardware encoder (H.264) and software encoder (VP8), software encoder is better but not the best. Can anyone have more options for optimization of video rendering, Thanks in advance.