Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Official Unity Render Streaming Introduction & FAQ

Discussion in 'Unity Render Streaming' started by kazuki_unity729, Sep 10, 2019.

  1. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    231
    You don't have the topic you want, just WebRTC for Unity in general.
    Some users are using only WebRTC for Unity without using Unity Render Streaming, so I want a thread for that user.
     
  2. Jrnze

    Jrnze

    Joined:
    Nov 16, 2021
    Posts:
    12
  3. Jrnze

    Jrnze

    Joined:
    Nov 16, 2021
    Posts:
    12
    Good Day :)

    Does the Render Streaming package support multiple different device inputs on the receiver side?? I am using the Receiver Sample html page as browser receiver and I can only control the Unity project via the first browser to stream. Other browsers can still stream but cannot control the Unity project.

    Thanks for the help :)
     
  4. Jrnze

    Jrnze

    Joined:
    Nov 16, 2021
    Posts:
    12
    Good Day :)

    Can Unity Recorder record and output webm videos thru web browser input when using Unity Render Streaming?

    Thanks and Kind Regards :)
     
  5. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
    WebSocket is only used for signaling, not for video streaming.
    Could you check how many bandwitdh of streaming consume?
     
  6. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
    Hi, Is the screen on browser what you want to record?
     
  7. kannan-xiao4

    kannan-xiao4

    Unity Technologies

    Joined:
    Nov 5, 2020
    Posts:
    43
    In that case, MultiplaySample will be helpful.
    In MultiplaySample, a single host receives input from multiple device.
    I think the cameras can be integrated into one.
    https://docs.unity3d.com/Packages/com.unity.renderstreaming@3.1/manual/sample-multiplay.html
     
  8. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
    gtk2k likes this.
  9. Jrnze

    Jrnze

    Joined:
    Nov 16, 2021
    Posts:
    12
    Good Day :)

    I would like to know how the buttons in the Web Browser Input sample scene and VideoPlayer html page works. Like how is it mapped to Unity, what codes are involved.

    Thank you and Kind Regards :)
     
  10. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    231
  11. xingyuxingyu

    xingyuxingyu

    Joined:
    Dec 12, 2019
    Posts:
    1
    Hello~
    I want to know how can I implement video streaming just by the texture?
    How can I assign a texture to RenderTexture?

    // Get a valid RendertextureFormat
    var gfxType = SystemInfo.graphicsDeviceType;
    var format = WebRTC.GetSupportedRenderTextureFormat(gfxType);

    // Create a track from the RenderTexture
    var rt = new RenderTexture(width, height, 0, format);
    var track = new VideoStreamTrack("video", renderTexture);
     
  12. Jrnze

    Jrnze

    Joined:
    Nov 16, 2021
    Posts:
    12
    Good Day :)

    I would like to know if the "Web Browser Input Channel Receiver" component could be used with the Receiver Sample html web server. Because I would like to add custom buttons to my Unity Render Streaming project, and I think (I honestly don't know other options) that it is the only way for me to map my buttons to Unity code.

    Thanks and Kind regards :)
     
  13. Quentin_Arago

    Quentin_Arago

    Joined:
    May 17, 2022
    Posts:
    1
    Hello there,

    Is there a better solution for local-only streaming than this package? We would like to be able to access our game through a web page with the game being run locally for the user.

    Thanks.
     
  14. dhruv_unity154

    dhruv_unity154

    Joined:
    Feb 11, 2022
    Posts:
    14
    Hello All,
    I've integrated render streaming in my VR app.
    When I enable camera for render streaming, App frame rate goes 72 to 30 fps. Because when enabled seconds camera two camera render scene same time so frame drop happen and FPS goes between 30to35. (1st Camera is VR Player Camera and Seconds Camera is Top View game camera for render streaming)

    What can be solution for this to make at stable at above 60 frame rate?

    Thanks. Any help appreciated
     
  15. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
    If you use the camera to stream video, you need to add the camera to display the camera view.
     
    dhruv_unity154 likes this.
  16. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
    You can use the constructor of the VideoStreamTrack.
    https://docs.unity3d.com/Packages/c...ity.WebRTC.VideoStreamTrack.html#constructors
     
  17. dua2

    dua2

    Joined:
    Jul 1, 2022
    Posts:
    1
  18. lanbaug

    lanbaug

    Joined:
    Nov 5, 2019
    Posts:
    2

    You are right. I have been beating my head around getting my custom scene to pass input through but unable to. The documentation for setting up Input is broken. Following the tutorial here doesn't help either.

    If you were able to make this work any help on migrating a simple custom scene with UI input to a render stream scene will be appreciated.
     
  19. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
  20. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
    Which Unity version are you testing?
    Currently Unity 2021.3 is prefered.
     
  21. Jrnze

    Jrnze

    Joined:
    Nov 16, 2021
    Posts:
    12
    how does the Multiplay sample work?? I need to have a string input from browser which I can then use in my codes in Unity. Thanks :)
     
  22. dhruv_unity154

    dhruv_unity154

    Joined:
    Feb 11, 2022
    Posts:
    14
    Hello All,
    I am facing issue regarding frame rate drop while streaming start on Oculus Quest2 VR app. Using broadcast feature to send stream to WebApp template VideoPlayer example. Streaming working as expected and good. But main big problem is, when streaming start, VR app FPS goes down to in range (25-35 FPS). If I am not starting streaming then, app runs at above 70FPS. So streaming starts is reason of fps drop. I've also created issue in github also: https://github.com/Unity-Technologies/UnityRenderStreaming/issues/716

    Is hardware encode support help in case of Oculus Quest2 to make stable fps? How hardware encode support works?
    Anyone have idea how can fix this fps drop issue and make app stable when stream starts?
     
    Last edited: Jul 20, 2022
  23. lanbaug

    lanbaug

    Joined:
    Nov 5, 2019
    Posts:
    2
    [UPDATE]

    I eat my words FORUM, but only partially. I was able to make it work by taking bits from the existing WebBrowserInput Sample scene.
    Apart from setting up the InputReceiver as mentioned here --

    https://docs.unity3d.com/Packages/com.unity.renderstreaming@3.1/manual/control-camera.html

    you will need to configure the RenderStreamingSettings and Run them? (lack of documentation)

    Code (CSharp):
    1. if (!renderStreaming.runOnAwake)
    2.             {
    3.                 renderStreaming.Run(
    4.                     hardwareEncoder: RenderStreamingSettings.EnableHWCodec,
    5.                     signaling: RenderStreamingSettings.Signaling);
    6.             }
    Without enabling the signaling or the HW codec, the app cannot seem to communicate.

    If anyone can shed light on what is going on here, it can greatly help us understand the system better.

    We are using Unity 2020.3.30f1 and Package 3.1.0-exp.3
     
    Last edited: Jul 20, 2022
  24. Jrnze

    Jrnze

    Joined:
    Nov 16, 2021
    Posts:
    12
    Excuse me, is this already fixed?? Thanks :)
     
  25. Jrnze

    Jrnze

    Joined:
    Nov 16, 2021
    Posts:
    12
    Good Day :)

    Why is UI Input Field not receiving text input from keyboard in the browser side of Unity Render Streaming?
     
  26. kannan-xiao4

    kannan-xiao4

    Unity Technologies

    Joined:
    Nov 5, 2020
    Posts:
    43
  27. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
    Sorry but I cannot make sense you are saying.
    If it is clear that we can fill the document to explain more detail about your issue.
     
  28. skowronski_m

    skowronski_m

    Joined:
    Oct 5, 2021
    Posts:
    35
    Hey, I am having trouble establishing two or more data channels on a single peer connection. Should this be in theory (and practice ;)) possible?

    After further examination: If I have several local datachannels with different labels in my LocalConnection class (based on the RenderStreaming samples) and connect to a different peer,
    ReadyState
    for all channels is Open but the sdp only notifies the other peer of one channel.

    Code (CSharp):
    1. webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:Z8k1\r\na=ice-pwd:N6bJDPzKqkhafnNwJ7Px9zp7\r\na=ice-options:trickle\r\na=fingerprint:sha-256 BD:B5:40:86:6F:42:CE:D3:5F:3A:49:64:5A:2D:50:91:89:09:CD:A1:CE:2C:01:9D:DB:CC:6F:E9:70:42:07:AB\r\na=setup:actpass\r\na=mid:2\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"}}
    Consequently, the other peer receives all messages on a single data channel which causes my application to crash.
     
    Last edited: Jul 26, 2022
  29. XB23

    XB23

    Joined:
    Sep 12, 2018
    Posts:
    20
    Hello, I have some problems with my project using webrtc and sfu JANUS, I made it targeting windows platform and the webrtc part works, but now I try to target IOS platform and struggle with the communication to send the offer.

    When I try to send the jsep to JANUS, JANUS receive parts of my offer but not the full offer. Does create offer on IOS works differently or am I missing something here ?

    I communicate with JANUS with a websocket, other requests are fine by the way.

    (Also, did you planned to add insertables streams?)

    Thank you and have a good day.
     
  30. skowronski_m

    skowronski_m

    Joined:
    Oct 5, 2021
    Posts:
    35
    Hey, we are running Unity Renderstreaming (latest version) and Janus together with several iOS devices and are not experiencing this issue..
     
    XB23 likes this.
  31. XB23

    XB23

    Joined:
    Sep 12, 2018
    Posts:
    20
    Hello, can you show me your JANUS configure_room call please ? Because if you do not have the problem, I am maybe making mistakes.
     
  32. kengorou2014

    kengorou2014

    Joined:
    Jun 12, 2018
    Posts:
    8
  33. skowronski_m

    skowronski_m

    Joined:
    Oct 5, 2021
    Posts:
    35
    We don't use that call (if you mean configure or joinandconfigure) but simply publish and/or join (depending on whether you are a publisher or subscriber)
     
  34. XB23

    XB23

    Joined:
    Sep 12, 2018
    Posts:
    20
    Hello !

    (How do you join a room which hasn't been created before?)

    So, can you show me how you create your offer/answer and how you send it through join/publish calls ? I think I misunderstood something, but I can't find what.

    I'm pretty sure that my formatting is the problem but the weird thing is that it works fine on windows platform.

    Thank you for your help !
     
  35. skowronski_m

    skowronski_m

    Joined:
    Oct 5, 2021
    Posts:
    35
    Yes, the part that it works on Windows also puzzles me.. We do not create rooms on the fly but use one predefined room to which we join.

    What do you mean by
    Which part is missing? Can you post an example jsep?
     
  36. XB23

    XB23

    Joined:
    Sep 12, 2018
    Posts:
    20
    There is my sended message and my received message (Sended from IOS and Received from my server when I send the jsep), sended is crop because it's too long, but it has the good format.
     

    Attached Files:

  37. wsadmld1

    wsadmld1

    Joined:
    Jun 1, 2021
    Posts:
    3
    Hello! I want to do that per unity application serves just one client, and there are a few clients, like this img.

    which i use is WebBrowerInput method. And the unity applications are the same one.

    how can i use the package to do this.
     

    Attached Files:

  38. wsadmld1

    wsadmld1

    Joined:
    Jun 1, 2021
    Posts:
    3
    I use singleConnection and connectionID to specify my peer. i can succeed in unity editor, but can't make it when i pack the program to .exe.

    i use singleconnection to replace the broadcast in webinputsample. Connectionids in web and unity are the same.

    what caused it? what should i pay attention when use singleconnection?
     
  39. Quentin_Ara

    Quentin_Ara

    Joined:
    Jan 31, 2020
    Posts:
    2
    Hello, what would it take to use only the input streaming part of the package?
     
  40. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
    Hi, you say that there are issues of the DataChannel callback. Right?
    We will check the issue.
     
  41. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
  42. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
    You mean you want to use only DataChannel, not audio and video, right?
     
  43. kannan-xiao4

    kannan-xiao4

    Unity Technologies

    Joined:
    Nov 5, 2020
    Posts:
    43
    I think the following issues maybe be useful.
    https://github.com/Unity-Technologies/UnityRenderStreaming/issues/670

    For the usage of Single Connection on one-to-one, refer to the Bidirectional Sample.
     
    dan_soqqle likes this.
  44. Quentin_Ara

    Quentin_Ara

    Joined:
    Jan 31, 2020
    Posts:
    2
    Yes.
     
  45. XB23

    XB23

    Joined:
    Sep 12, 2018
    Posts:
    20

    Attached Files:

  46. dan_soqqle

    dan_soqqle

    Joined:
    Feb 2, 2022
    Posts:
    70
    hi all, can i check if there may be a sample for multiple connections (for example 4)?

    My plan now is to take the bidirectional and create multiple singleConnections. And i hope that is the right thing to do . . .
     
  47. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
  48. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
    It show the Janus error.
    "Returning Janus API error 456 (Missing mandatory element (transaction))"

    I am not sure but this thread is hit for the error log above.
    https://groups.google.com/g/meetecho-janus/c/eVwaE9IkDDg
     
  49. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    543
  50. dan_soqqle

    dan_soqqle

    Joined:
    Feb 2, 2022
    Posts:
    70
    Thank you for this. I think i will progress with something similar. If i'm not wrong if i have multiple users connecting to the same connectionId it should work the same. Right now i am letting my users go with 2 connections. Once it works fine i will continue to increase to more..