VLC stream to render texture

 

 In VLC, click Stream

Select your media, click stream

Add a HTTP, choose a port - say "8080", and give it a name, lets say "q"

Make sure you activate "transcoding". Select Ogg as the main wrapper. In the video codec tab, select "Theora" (this is the ogg video codec I think). Save this preset, hit next and then finally Stream.

I haven't figured out how to stream a playlist yet. Perhaps using VLC in command line mode?

 

In Unity, create a Videoplayer object. Set it to render to a Render Texture(and assign this render texture to a material on a quad or something).

For the video player's source, set it to URL and enter something resembling the following -

http://192.168.1.44:8080/q

the 192.168.1.44 will be your machine's IP (run ipconfig in command prompt to find out what it actually is). The :8080 is to access the port you specified earlier, the "q" is what we named the stream.


Now if you hit play , your object should have the playing movie as a texture! Very nice.

Last nugget - to get this rendertexture to tile, if you are doing funky things with the UVs for example - you will have to set depth to zero. Apparently this will be fixed in future versions of Unity...but they've been saying this for quite a while (at time of writing I'm using 2021.1.11f).

Comments

Popular posts from this blog

setting VFX graph properties using C#