Search Unity

Video Screen share application

Discussion in 'Audio & Video' started by theiajsanchez, Nov 7, 2017.

  1. theiajsanchez

    theiajsanchez

    Joined:
    Feb 2, 2017
    Posts:
    18
    Hi everyone,

    I'm currently developing an application that shares the scene view to another user using a websocket connection and screenshots (taken by ReadPixels() method).

    The problem is that encoding that texture into JPG with a quality of 15% we got a 30KB file wich is too heavy for sharing with another user over the network, and the entire application starts to behave slowly (because every frame the application sends that encoded image through the websocket connection).

    Which is the best way for getting a lightweight image for sending it over the network?

    Thanks in advance.
     
    Last edited: Nov 7, 2017
  2. theiajsanchez

    theiajsanchez

    Joined:
    Feb 2, 2017
    Posts:
    18
  3. Erethan

    Erethan

    Joined:
    Apr 27, 2015
    Posts:
    28
    I've used the same strategy and I have the same issue.

    Even though you are sending an img frame, and you want to send it just as you render a frame, you could use a video encoder. That would reduce the payload drastically.

    GamingAnywhere is a cloud gaming platform that uses x264 to encode their "screens".
    http://gaminganywhere.org/doc.html

    However, I don't know how I would implement something like yet. I've created a thread to discuss that.
    https://forum.unity.com/threads/real-time-video-streaming.505948/