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. 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

WebRTC to wowza

Discussion in 'Unity Render Streaming' started by fabricio_unity429, Mar 16, 2022.

  1. fabricio_unity429

    fabricio_unity429

    Joined:
    Jan 2, 2022
    Posts:
    1
    Is it possible to stream directly from Unity to a Wowza server using Unity Render Streaming? or do I still need a web server in between?

    When running the Broadcast sample pointing to a wowza signaling url (wss://XXX.streamlock.net:8443/webrtc-session.json) I see the connection is successful but the stream never seems to get to wowza.

    On wowza we have the concept of a "Application Name" and a "stream name", what would be the equivalents in unity render streaming?
     
  2. kannan-xiao4

    kannan-xiao4

    Unity Technologies

    Joined:
    Nov 5, 2020
    Posts:
    42
    Probably because the Signaling protocol is incorrect.
    Package's WebsocketSignaling has only been confirmed to work with our WebApp.
    So, please implement Wowza Signaling class using ISignaling Interface.
     
  3. turntengineering

    turntengineering

    Joined:
    Mar 31, 2022
    Posts:
    1
    Hi @fabricio_unity429 I'm interested in building this signaling protocol. Getting render streaming into Wowza server would open a lot of interesting use cases. Have you tried this yet?
     
  4. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    230
    I wrote a sample to stream from Unity to Wowza using WebRTC.
    (The scene is a "Wowza Streaming Sample" scene)
    Unity_WowzaStreaming_Sample

    Click the "Start Live Stream" button on the Wowza dashboard to start Live Stream before running this sample.

    Note: It doesn't show up in the VIDEO PREVIEW on the Wowza dashboard, but you can see that the STATISTICS value is changing.
    You can check the streaming by accessing the URL of WebRTC Playback Page or Playback URLs and playing.
     
    kazuki_unity729 likes this.
  5. al3xj3ns3n

    al3xj3ns3n

    Joined:
    Sep 10, 2018
    Posts:
    11
    Hey @gtk2k, do you know if its possible to configure that sample to work on Unity 2019.4.21f1? It's working great on 2021.3.6f1 but when trying to port it over the connection attempt starts returning this error:

    Failed to set local offer sdp: Failed to set local video description recv parameters for m-section with mid='0'.


    EDIT: Actually nevermind figured it out. Line 105 needs to be changed to
    WebRTC.Initialize(EncoderType.Software);
     
    Last edited: Jul 15, 2022
  6. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    230
    @al3xj3ns3n
    What version of "WebRTC" Package are you using?
     
  7. al3xj3ns3n

    al3xj3ns3n

    Joined:
    Sep 10, 2018
    Posts:
    11
    @gtk2k We're running 2.4.0-exp.6, and I'm actually running into a new problem now trying to get things implemented in the main application. In the CreateDesc method the yield return op line appears to stall out. I'm seeing the WSOnOpen and StartStreaming debug messages, but it seems like the ICE isn't updating. We've got it connected up to a Spout Receiver to get a webcam feed from OBS, and that part works fine in the example project you provided, but when we try to carry that code over into our own app it stalls for some reason.
     
  8. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    540
    Have you solved the issue? I recommend to use the new version.
     
  9. al3xj3ns3n

    al3xj3ns3n

    Joined:
    Sep 10, 2018
    Posts:
    11
    We did manage to figure out what the issue was yes, it was specific to our project, the ctx was being set in another system and we needed to account for that change to get it to connect properly. Currently I'm trying to work out how I would then best receive a webcam signal from the WebRTC wowza server back to the Unity app. Our current receiver runs through VLC and it is managing to receive the feed correctly, but it still has pretty significant latency which we don't see on the WebRTC playback page so I'm assuming there's still some format swapping causing a slowdown.
     
    Last edited: Aug 10, 2022
  10. al3xj3ns3n

    al3xj3ns3n

    Joined:
    Sep 10, 2018
    Posts:
    11
    Are there any examples demonstrating sending a WebRTC signal from Wowza back into Unity? I've created a wowa receiver which is set up similar to the wowza connector with trackers to try and receive the texture, but the Ws_OnMessage doesn't appear to be firing when it tries to connect.
     
  11. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    540
    Mm, sorry but we have never tested our product with Wowza.
    Does anyone have the experience about that?
     
  12. al3xj3ns3n

    al3xj3ns3n

    Joined:
    Sep 10, 2018
    Posts:
    11
    Do you know if its possible to set up a wowza receiver to go with this to stream from Wowza back into Unity without running into significant feed delays? I've been trying to get our system to work with it, but I'm still seeing several seconds of delay between the stream sending out and getting sent back.
     
  13. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    540
    I have not tested it with wowza but it seems strange that Unity is running with the significant delays.
    @gtk2k Have you seen the delays with you sample?
     
  14. duckatfake

    duckatfake

    Joined:
    Mar 8, 2018
    Posts:
    3
    Did you try to check the Prioritize latency to create an HLS stream with the lowest latency possible in the Live Stream Setup? Otherwise it might just be the lowest latency you can get from Wowza as there's no "SFU Passthrough" for WebRTC.
     
unityunity