Jump to content

VideoTexture, 1 frame per render loop


igitz
 Share

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.

Link to comment
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.

Link to comment
Share on other sites

  • 4 weeks later...
//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 (?)

Link to comment
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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...