Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Low bitrate for stream

Discussion in 'Unity Render Streaming' started by Myrtanim, Aug 11, 2023.

  1. Myrtanim

    Myrtanim

    Joined:
    May 8, 2015
    Posts:
    2
    Hi,

    I have a Full HD (1080p) render stream up and running between two PCs over a 1Gbps LAN. The LAN is segmented into two virtual LANs, one where the Signal Server and the streaming Unity app resides and one where the Web Browser clients are.
    The VLANs are separated by a firewall, but the necessary ports (TCP & UDP 3333 for the Signal Server and TCP & UDP 32767-65535 for the direct connection) are open and I get a stream. Though the bitrate is very low (~780 Kbps) and thus the framerate is also extremely low (between 1 and "undefined" FPS). I have set the max bitrate to 30,000 Kbps in code.

    When I test it locally on the same machine it runs fine with 50-60 FPS and the achieved bitrate is around 15,000 kbps.

    I am a bit lost where to check what the problem could be. File transfer in the LAN works fine and maxes out the 1Gbps connection without problems, so theoretically the bandwidth is available.

    Can anyone help me to further diagnose the problem, please? What could be the cause of the low bitrate?

    Greatings,
    Myrtanim
     
    Last edited: Aug 24, 2023
  2. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    796
    Your issue is, the network bandwidth is fine, but you can't stream video with the quality you expect. This is a difficult problem to pinpoint the cause.

    I think you can isolate whether the problem is on the Unity side or the network by testing WebRTC communication with two Google Chromes.
     
  3. Myrtanim

    Myrtanim

    Joined:
    May 8, 2015
    Posts:
    2
    Thanks for the input. The WebRTC communication with two Chromes runs fine and produced higher bitrates and a smoother experience. So the problem is on Unity side, but I noticed that contrary to my previous tests the game's framerate is indeed only 3 FPS on the machine, so the stream can't get higher then this.

    I will try to optimize the game further to get higher FPS.

    Thank you for your help!
     
    kazuki_unity729 likes this.