let video = document.querySelector("video");
let canvas = document.querySelector("canvas");
let ctx = canvas.getContext("2d");
video.addEventListener('play', function() {
ctx.drawImage(video, 0, 0, width, height);
let frame = this.ctx1.getImageData(0, 0, this.width, this.height);
});