igitz

VideoTexture, 1 frame per render loop

Recommended Posts

Hello, is there a way to advance a VideoTexture by just 1 frame per RenderLoop?

As I understand it now it is time based. This creates the problem that if the frames need to be captured to create an animated sequence, the video keeps advancing in between 2 captured frames.

Share this post


Link to post
Share on other sites

thanks Deltakosh, i actually did try this, but i had a 'disappearing video' issue. Which is:

in order to set the .currentTime manually at each render loop, i would like for the html video to be paused.

setting videoTexture.video.autoplay = false or videoTexture.video.pause() when creating the videoTexture do not work, the video starts playing anyway. so i tried video.pause() in the render loop, which makes the texture disappear as soon as the .currentTime is called.

Share this post


Link to post
Share on other sites
//before render loop
var texVideo = new BABYLON.VideoTexture("video", ["./data/textures/video.mp4"],scene);
var htmlVideo = texVideo.video;
texVideo._autoLaunch = false;

hi @Deltakosh, the problem with this, is that the texture appears black.

so even when setting currentTime later, nothing appears.

//set current time
htmlVideo.currentTime = 50;
texVideo.update();

Unless i'm doing something wrong (?)

Share this post


Link to post
Share on other sites

@Deltakosh It is worth noting that this trick with _autoLaunch will not work when used from TypeScript - this property is private.

This is part of why I created my own VideoTexture that does not take control of playback and just depends on events. Another part is that I needed to prevent `updateVideoTexture` calls for textures that are not visible. It asks for more wiring to detect visible textures through visible meshes and therefore is not currently in shape to replace current VideoTexture, but would you be interested in discussing ways to integrate this into the engine?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.