# Video stream inside scene

**URL:** <https://forum.babylonjs.com/t/video-stream-inside-scene/19414>\
**Category:** Questions\
**Created:** [March 23, 2021, 2:53pm UTC](https://forum.babylonjs.com/t/video-stream-inside-scene/19414 "2021-03-23T14:53:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [March 23, 2021, 2:53pm UTC](https://forum.babylonjs.com/t/video-stream-inside-scene/19414/1 "2021-03-23T14:53:36Z")

</div>

Hi there,  
i’d like to do something similar to this old topic: [Camera stream on WebGL - #4 by fselcukcan](https://forum.babylonjs.com/t/camera-stream-on-webgl/3568/4) but, as i’ve specified in the last post, i’d like to put the stream in foreground.  
The porpouse is to insert a viedo stream of a person inside the scene (for example using green screen technique or similar).  
Do you think is it possible?

---

<div class="post-metadata">

**Author:** ![Knar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/knar/32/14900_2.png) [@Knar](https://forum.babylonjs.com/u/Knar)\
**Post date:** [March 23, 2021, 3:13pm UTC](https://forum.babylonjs.com/t/video-stream-inside-scene/19414/2 "2021-03-23T15:13:40Z")

</div>

I think it’s possible. You would have to edit out the green screen in a video editor and export it to a format that has alpha channel (transparency) data. Webm seems like it might work, I would try that on a VideoTexture first.

You can also export the video as a bunch of png files and put them on a mesh if there’s no better way.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [March 23, 2021, 3:22pm UTC](https://forum.babylonjs.com/t/video-stream-inside-scene/19414/3 "2021-03-23T15:22:19Z")

</div>

This could help: [Video As A Texture | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/materials/using/videoTexture)

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [March 23, 2021, 3:27pm UTC](https://forum.babylonjs.com/t/video-stream-inside-scene/19414/4 "2021-03-23T15:27:58Z")

</div>

Nice example - [https://playground.babylonjs.com/#GH6TZV#3](https://playground.babylonjs.com/#GH6TZV#3)  
This thread also may be helpful:  
[Mp4 video alpha transparency](https://forum.babylonjs.com/t/mp4-video-alpha-transparency/15230)

---

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [March 23, 2021, 3:42pm UTC](https://forum.babylonjs.com/t/video-stream-inside-scene/19414/5 "2021-03-23T15:42:40Z")

</div>

Thank you everyone, i’ll try following the examples you’ve posted 😉

---

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [March 25, 2021, 7:47pm UTC](https://forum.babylonjs.com/t/video-stream-inside-scene/19414/6 "2021-03-25T19:47:11Z")

</div>

I think a can reach the effect i need, thank you all 👍  
I was wondering if it’s possible to use as a video stream also a youtube video. Could it work?

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [March 25, 2021, 8:26pm UTC](https://forum.babylonjs.com/t/video-stream-inside-scene/19414/7 "2021-03-25T20:26:53Z")

</div>

For Youtube video see here - [Youtube video as video texture](https://forum.babylonjs.com/t/youtube-video-as-video-texture/9987)  
Another way is to use CSS3DRenderer.
