Closed vihar1996 closed 3 years ago
use webgl video renderer to render it into canvas
i am new to this field so can you please send me code sample for this
thank you so much it worked @boonzie
can you post what you used as an example for others?
I used following code snippet and it worked for me. Also add webchimera.js to your node modules
var canvas = document.getElementById("your-canvas-id");
var renderContext = require("webgl-video-renderer").setupCanvas(canvas);
var player = require("webchimera.js").createPlayer();
player.onFrameReady =
function(frame) {
renderContext.render(frame, frame.width, frame.height, frame.uOffset, frame.vOffset);
}
player.play("http://archive.org/download/CartoonClassics/Krazy_Kat_-_Keeping_Up_With_Krazy.mp4");
once the player starts playing the video call canvas.toDataURL()
method to get snapshot/image in base64 format
I got the uint8array but i am unable to process it to an image