function captureImage () {
var scale = 0.25;
var txt = document.querySelector('div p .external');
video = document.querySelector("video");
var canvas = document.createElement('canvas');
canvas.width = video.videoWidth * scale;
canvas.height = video.videoHeight * scale;
canvas.getContext("2d").drawImage(video, 0, 0, canvas.width, canvas.height);
var img = document.createElement("img");
img.src = canvas.toDataURL();
// console.log(img.src)
txt.appendChild(img)
}