• canvas 在视频中的用法


    <!doctype html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>model</title>
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <style>
            *{margin:0;}
        </style>
    </head>
    <body>
        <div>
            <canvas id="mycanvas" width="640" height="1039"></canvas>
        </div>
    
        <video class="" id="video" width="640" autoplay style=" display:none;">
            <source src="images/video.mp4" type='video/mp4'>
        </video>
    <script type="text/javascript" src="js/setviewport.js"></script>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script>
        function playVideo() {
            var myvideo=document.getElementById("video");
    
            var c=document.getElementById('mycanvas');
            var ctx=c.getContext("2d");
    
            ctx.clearRect(0,0,640,1039);
            ctx.drawImage(myvideo,0,0,640,1039);
    
            stopCanvas = setInterval(function () {
                ctx.clearRect(0,0,640,1039);
                ctx.drawImage(myvideo,0,0,640,1039);
            },30)
        }
        playVideo();
    </script>
    
    </body>
    </html>
  • 相关阅读:
    几种网络LeNet、VGG Net、ResNet原理及PyTorch实现
    学习Faster R-CNN代码faster_rcnn(八)
    应用安全
    应用安全
    应用安全
    应用安全
    应用安全
    渗透测试
    应用安全
    应用安全
  • 原文地址:https://www.cnblogs.com/chiangyibo/p/7067641.html
Copyright © 2020-2023  润新知