UnityRenderStreaming icon indicating copy to clipboard operation
UnityRenderStreaming copied to clipboard

[REQUEST]: Encode on a separate thread?

Open ZeoWorks opened this issue 3 years ago • 11 comments

Is your feature request related to a problem?

Hi, when using either software or hardware encoding; It seems that the in-game frame rate is limited by the successful encoding frame rate.

Can we have the encoding done on a separate thread so the main thread is free to have as high of a frame rate as it likes?

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

ZeoWorks avatar May 05 '22 09:05 ZeoWorks

+1

rocco-haro avatar May 05 '22 16:05 rocco-haro

We discussed about the same issues here. https://github.com/Unity-Technologies/com.unity.webrtc/issues/632#issuecomment-1110478225

We are going to support controlling framerate for the next milestone.

karasusan avatar May 10 '22 02:05 karasusan

memo: WRS-229

karasusan avatar May 10 '22 02:05 karasusan

We discussed about the same issues here. Unity-Technologies/com.unity.webrtc#632 (comment)

We are going to support controlling framerate for the next milestone.

Having the frame rate controlled by another variable is a different thing than it being encoded on a separate thread no?

ZeoWorks avatar May 10 '22 10:05 ZeoWorks

+1 De-/Encoding video on its own thread would be absolutely essential for this type of application if this is not already the case.

pilzinho avatar May 10 '22 10:05 pilzinho

@ZeoWorks In the next version of WebRTC package, the encoding process runs on the worker thread, not rendering thread. There was one more problem with that, the encoding framerate is limited by the in-game framerate.

karasusan avatar May 11 '22 01:05 karasusan

@karasusan may you please share a link to the file where the encoding process takes place?

rocco-haro avatar May 12 '22 18:05 rocco-haro

@rocco-haro The encoding process is implemented in the native code. https://github.com/Unity-Technologies/com.unity.webrtc/tree/develop/Plugin~/

karasusan avatar May 13 '22 03:05 karasusan

@karasusan thanks, but that link leads to a 404 page.

rocco-haro avatar May 13 '22 16:05 rocco-haro

~

Link seems broken, you need to include ~ at the end of it.

ZeoWorks avatar May 13 '22 18:05 ZeoWorks

We already merged the fix which updates the dependencies of WebRTC package, so you can test the encoder on a separated thread and check the performance. https://github.com/Unity-Technologies/UnityRenderStreaming/pull/683

karasusan avatar Jul 12 '22 05:07 karasusan