Search Unity

Stream live video feed into Unity3D

Discussion in 'Scripting' started by Paul Graystone, Dec 13, 2013.

  1. Paul Graystone

    Paul Graystone

    Joined:
    Dec 15, 2012
    Posts:
    2
    Hello Unity3D-Users :),

    I want to stream a remote Windows desktop into my Unity Scene. The desktop is streamed using VLC and an OGG Live Video Stream, which can be reached at "http://192.168.1.1:8080/vlc". I attached following script to a simple box:

    Code (csharp):
    1.  
    2. var url = "http://192.168.1.1:8080/vlc";
    3.  
    4. function OnMouseDown(){
    5.     var www = new WWW(url);
    6.     var movieTexture = www.movie;
    7.     while(!movieTexture.isReadyToPlay) yield;
    8.     renderer.material.mainTexture = movieTexture;
    9.     audio.clip = movieTexture.audioClip;
    10.     movieTexture.Play();
    11.     audio.Play();
    12.     }
    As you might guess, this does not work at all. Hence I am wondering is it even possible to stream OGG into Unity3D?

    Thank you for your help!
     
  2. TheRaider

    TheRaider

    Joined:
    Dec 5, 2010
    Posts:
    2,250

    I want to bump this cause I want to know if possible too!
     
  3. TheRaider

    TheRaider

    Joined:
    Dec 5, 2010
    Posts:
    2,250
    I got a message from support on this, it is easy to read the features as supporting this but they obviously mean you can stream a static video not a live stream since support confirmed to me live streams are not supported.
     
  4. raziel1492

    raziel1492

    Joined:
    Nov 9, 2013
    Posts:
    1
    This is possible. I've actually had this working for over a year now. The catch is that you need Unity Pro. And as you mentioned earlier it is limited to OGG format. There is a bit of delay in the stream (2 seconds - 5 seconds, depending on a bunch of factors).
     
  5. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    699
    I have Unity Pro and I can't get this to work. Can you please tell me what kind of settings you're using for the live stream? I can stream a file over the network, but I can't get a live-transcode-stream working inside unity (works if I stream to VLC)
     
  6. si1984

    si1984

    Joined:
    Sep 20, 2014
    Posts:
    3
    any luck yet col000r i need this also
     
  7. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,532
    I just played with this using a stream. And for some reason the stream doesn't return true for 'isReadyToPlay'.

    I just waited for a second, and started playing none the less, and it worked. Framerate was garbage, but it played.
     
  8. Next-aeon

    Next-aeon

    Joined:
    Aug 26, 2015
    Posts:
    1
    did anyone find solution? I need it too
     
  9. vimevim

    vimevim

    Joined:
    Feb 17, 2019
    Posts:
    4
    any solve?
     
  10. yerriswamy

    yerriswamy

    Joined:
    Apr 10, 2015
    Posts:
    2
    hi any solution, if please respond.
     
  11. jbruell94

    jbruell94

    Joined:
    Apr 10, 2021
    Posts:
    1