igitz Posted December 15, 2017 Share Posted December 15, 2017 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 15, 2017 Share Posted December 15, 2017 video is read using the video tag which will advance on its own timer which is clearly not the same as the rendering (24fps vs 60fps). You can always use videoTexture.video, and then move the current position manualy Quote Link to comment Share on other sites More sharing options...
igitz Posted December 16, 2017 Author Share Posted December 16, 2017 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 18, 2017 Share Posted December 18, 2017 There is a trick to stop autoplay with: texture._autoLaunch = false Also you can force the texture to update when you touch the video element with texture.update() Quote Link to comment Share on other sites More sharing options...
igitz Posted January 12, 2018 Author Share Posted January 12, 2018 //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 (?) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 12, 2018 Share Posted January 12, 2018 Would you mind reproducing what you currently have in the pG? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 12, 2018 Share Posted January 12, 2018 keep in mind, I do not think you can autoplay on mobile. I might be mistaken but I remember this being an issue at one point on a project. Don't know if that is relevant for you or not. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
igitz Posted January 15, 2018 Author Share Posted January 15, 2018 @Deltakosh yes i can definitely try to reproduce it. i'm using a shaderMaterial and have external shader files, can i actually do that in the pG? @Pryme8 thanks for the info, it is not relevant in this case. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 16, 2018 Share Posted January 16, 2018 For external files, they have to be accessible regarding CORS but beside that, yes you can! Quote Link to comment Share on other sites More sharing options...
edzis Posted January 17, 2018 Share Posted January 17, 2018 @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? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 17, 2018 Share Posted January 17, 2018 The autoLaunch property can be exposed easily if this is a missing feature you need And for sure, I'm always interested to discuss improvements Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.