unityRenderStreaming3.1.0-exp5 When the video is pushed from unity to web,delay

unityRenderStreaming3.1.0-exp5 When the video is pushed from unity to web,The web side has a significant delaycompared to unity,how to solv it。Next question, In a LAN environment,how to set the parameters of the videostreamder component to achieve the highest display effect,Last question, how do I enable hard coding。thanks a lot。

The latest version of Unity Render Streaming is exp.6. Please try to update the package.
It is trade-off between video quality and network bandwidth. Please try to change video parameters in realtime.
Please check the doc to use Hardware codec. You need to set the “Video Codec” option on VideoStreamSender component.

  • Does choosing H264 mean choosing hardware coding

Yes.

When the unity application and the web are on the same machine, there is also a 100ms delay in the streaming screen. How can we achieve no screen delay。Is the delay between the Unity screen and the web page unavoidable?

A 100ms delay is not normal in localhost.
Video resolution is one of the reason of the latency.
How to measure the latency?

8967645--1232631--1.png
The RenderStreaming configuration of the project is as above. This is a URP project. For the clarity of the picture, I chose the resolution of 1920*1080 and Increase the bit rate,In my personal tests, streaming latency is inevitable. I got the OS time in Unity, Then put the web screen with the Unity screen to take a screenshot to get latency information

It looks no problem to me. What kind of GPU are you using?

NVIDIA GeForce RTX 3070,What I care about is, when you’re testing, are there no delays? Previously, Webrtc 2.3.3-preview was used to push the video stream to the web without delay, and I will give the code in the attachment. Now, after using unityRenderStreaming-3.01-exp.5, the delay is inevitable. So I was wondering if that’s true for you, and could you tell me your test results? Thanks!

8971513–1233457–KDWebrtcUser.cs (16.9 KB)

I assume that the high latency is caused by the video codec.
You can see the video codec on the Unity CPU profiler

8986141--1236877--upload_2023-5-2_13-36-53.png

8990479--1237792--Snipaste_2023-05-04_10-09-23.png 8990479--1237795--Video202354101902.gif
Hello, my analysis tool page and run page display as shown in the figure, is this delay situation normal, Web and Unity on a computer

The delayed results of the project have been shown. Is this result normal? Are your results the same as mine? This is very important to me, please reply to me as soon as possible, thank you!

Surely the delay of image is long, but it looks no problem in the profiler window.
I am concerning that the framerate of the video sender and video resolution.

Is there such a delay when testing your project?

The commonly used resolution of the project is 19201080/25601440, and the bit rate interval is set to 5000~100000

How about HD resolution(1280x720)? If it improved by changing resolution, the reason is graphics performance.

HD resolution(1280x720) also suffers from latency9018079--1243585--录制_2023_05_17_10_08_05_91720235171012101.gif

It looks strange.
Can you check the webrtc-internal in Google Chrome?
https://bloggeek.me/webrtcglossary/webrtc-internals/

9030469–1246426–webrtc_internals_dump (2).txt (483 KB)

Thank you for sharing the dump file.
It looks 60FPS, can you decrease to 30FPS?

9045274--1249417--upload_2023-5-30_15-31-2.png