Importing a local VLC stream as a Movie texture.

Hi there,

I’m fairly new to Unity 3D and am using it to create a fairly simple interactive and sculptural game of sorts for an art project.
My knowledge of coding is bare min but I’ve gotten over most hurdles that Unity has thrown my way until now.
The goal for my final scene is to have the player be greeted by a large version of himself. This will be done with a hidden Xbox Kinect running through Processing to create a funky visual. I’ve then worked out that I can stream said visual to another computer (a different part of the installation) via VLC’s local stream support.
Does anyone know if it is possible to import said stream as a live movie texture into Unity3d? At the moment I’m able to access to the stream via webbrowsers and other mediaplayers by streaming the http:myipaddress:correctport but I’m unable to get this working via the standard www.texture.

var url = "http://10.166.11.239:8080";

var movieTexture;

function Start ()

{
 
    var www = new WWW (url);
 
    var movieTexture = www.movie;
 
    while (!movieTexture.isReadyToPlay)
 
        yield;
 
 
 
    renderer.material.mainTexture = movieTexture;
 movieTexture.Play (); 

}

In an attempt I’ve hosted a local webserver with MacOS’s standard WebSharing application which I believe is based on the apache server. On this I’ve set this

<ASX version ="3.0">
  <TITLE>Stream1234</TITLE>
  <ENTRY>
    <REF HREF="http://10.166.11.239:8080" />
  </ENTRY>
</ASX>

and I can fetch this with

<html><body><embed src="localstream1234.asx">
</body></html>

This runs as I said on a browser and well with other instances of VLC

I’m streaming it as http, WMV1, 192 kb/s, ASF

If anyone has managed to stream live video like this without resorting to setting up a proper .NET server with socket senders/listeners (something I don’t understand and don’t think I will soon) then I’d be extremely grateful for any help you can offer.

Best,
TC

Hi,

Have you got any further with this? I have read that this will only work with ogg format video?
I am in a similar situation, cant get the stream to load without actually serving this from a webserver. I get a 404 error back from the WWW object but the address is correct.

you can stream a video only directly and only theora ogg yes, because it’s the only codec supported by Unity.
so your url should point to a video directly:

www = new WWW ("http://mywebsite.com/myMovie.ogg");

actually i think the webserver is serving a webpage that only some software can interpret to stream the movie, as a webbrowser, but unity needs directly the url of the video.