일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- nodemon
- python install 3.7
- OpenCV
- skbuild
- 유튜브채널
- nodejs
- ubuntu
- 상위유튜버
- root
- python 3.7
- pip3
- #PostgreSQL
- python3.7
- Mermaid
- sequence diagram
- template
- linux
- 유튜브영상
- python 3.7 install
- 유튜브조회수
- PYTHON
- 유튜브수익
- 유튜브홍보
- 유튜브구독자
- vim
- opencv-python
- error
- nunjucks
- sshd_config
- Python3
우리집
VIDEO Tag Capture by Base64 본문
<html>
<head>
<title>Express</title>
<link rel="stylesheet" href="/stylesheets/style.css">
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<!-- <script src="javascripts/3.js"></script>-->
<!-- <script src="javascripts/test.js"></script>-->
<script src="javascripts/download.js"></script>
</head>
<body>
<video id="video" width="900" height="800" muted autoplay controls>
<source src="resource/test.mp4" type="video/mp4">
</video>
<button id="down">다운로드</button>
<canvas id="canvas" hidden></canvas>
<script>
const video = document.querySelector('video');
const btn = document.querySelector('#down');
btn.onclick = () => {
downloadCapture2();
}
function downloadCapture2() {
const canvas = document.getElementById('canvas');
canvas.width = 1920;
canvas.height = 1080;
canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
const scale = 0.7;
const canvasValue = canvas.toDataURL('image/jpeg', scale); // Base64 저장 - 0 ~ 1 퀄리티 범위
console.log(canvasValue);
}
</script>
</body>
</html>