Video streaming to texture?

Does anyone know how to live stream video+audio to a texture? How can we set up some kind of videocasting, like hosting a live video interview, on to a texture?

You have the VideoTexture for that:
https://doc.babylonjs.com/how_to/video_texture

(check the CreateFromWebCam API: https://www.babylonjs-playground.com/#1R77YT#32)

yes I’ve seen those pages.

What I’m trying to achieve is someone make a live video somehow (via their web cam or video player) and streaming that across the internet into a video texture on another server. So with this I can have 20 people all watching some person being interviewed live at the same time, but on a video texture of a 3D TV screen.

The webcam trick that I can see here only works to the local computer, or is there a way to convert that into data that can be streamed to many computers?

Yes but this is the same. The videoTexture can point either to the local web cam or to a server stream url

ok, I think I can figure it out if I combine videoTexture with the information here How video streaming works on the web: An introduction

Because its live streaming I can’t use just one URL. I have to continuously get a new buffer. All good! Video texture does what it should do. The rest is outside of Babylon.js, just standard Javascript coding I think.

I got it working!

This is streaming from a live DASH server to video texture:
https://www.babylonjs-playground.com/#9FSDC7#13

2 Likes