# Is it possible to record offscreen part of the scene to video, or capture as image?

**URL:** <https://forum.babylonjs.com/t/is-it-possible-to-record-offscreen-part-of-the-scene-to-video-or-capture-as-image/54700>\
**Category:** Questions\
**Tags:** offscreencanvas\
**Created:** [November 12, 2024, 4:59am UTC](https://forum.babylonjs.com/t/is-it-possible-to-record-offscreen-part-of-the-scene-to-video-or-capture-as-image/54700 "2024-11-12T04:59:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antony](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/antony/32/34501_2.png) [@Antony](https://forum.babylonjs.com/u/Antony)\
**Post date:** [November 12, 2024, 4:59am UTC](https://forum.babylonjs.com/t/is-it-possible-to-record-offscreen-part-of-the-scene-to-video-or-capture-as-image/54700/1 "2024-11-12T04:59:33Z")

</div>

Hi everyone,

Is it possible to record offscreen part of the scene to video, or capture as image? I’ve tried the following:

1. Offscreen canvas, but it doesn’t support record video. I searched forum that seems capture screenshot is possible with a hack (like setting an internal variable first), but I followed and no successful callback and no error either.

2. I tried follow the approach in this forum post:  
[https://forum.babylonjs.com/t/record-certain-part-of-the-scene-in-babylon-using-babylon-recorder/51986](https://forum.babylonjs.com/t/record-certain-part-of-the-scene-in-babylon-using-babylon-recorder/51986)

but this approach cannot record anything that isn’t drawing on the canvas

Why I want to do this is because I want to show user some content, but I created some animations on the other side where I don’t want user to see and record videos (or frame sequences) in the background. The worker approach would be perfect, but if it can’t be done, at least I want to do the recording for the content that user cannot see. Please advice how to achieve this if it is even possible to do. Thank you very much 😊

Antony.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 12, 2024, 10:26am UTC](https://forum.babylonjs.com/t/is-it-possible-to-record-offscreen-part-of-the-scene-to-video-or-capture-as-image/54700/2 "2024-11-12T10:26:39Z")

</div>

Maybe this could help?

> [@OffscreenCanvas VideoTextures](https://forum.babylonjs.com/t/offscreencanvas-videotextures/35077):
>
> I think you can already guess the challenge I’m facing from the thread title. As I understand it we can’t use VideoTexture from a WebWorker context because WebWorkers don’t have access to the DOM and can’t create video elements. In looking for workarounds I thought I might stream the video frames to the worker individually as images, and update a DynamicTexture instead on the worker side; however, the task is not trivial, and I have no clue if that’s really efficient; and since my app is quite…

---

<div class="post-metadata">

**Author:** ![Antony](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/antony/32/34501_2.png) [@Antony](https://forum.babylonjs.com/u/Antony)\
**Post date:** [November 12, 2024, 12:21pm UTC](https://forum.babylonjs.com/t/is-it-possible-to-record-offscreen-part-of-the-scene-to-video-or-capture-as-image/54700/3 "2024-11-12T12:21:06Z")

</div>

Thanks Evgeni, let me try. 🙂
