js实现浏览器将视频指定区域马赛克处理保存本地代码

代码语言:html

所属分类:其他

代码描述:js实现浏览器将视频指定区域马赛克处理保存本地代码,框选指定区域马赛克处理。

代码标签: js 浏览器 视频 指定 区域 马赛克 处理 保存 本地 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>视频马赛克处理工具</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            padding: 30px;
        }

        h1 {
            text-align: center;
            color: #333;
            margin-bottom: 30px;
            font-size: 28px;
        }

        .controls {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            transition: all 0.3s;
            font-weight: 500;
            position: relative;
            overflow: hidden;
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }

        .btn-success {
            background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
            color: #333;
        }

        .btn-danger {
            background: linear-gradient(135deg, #fc6b6b 0%, #ff6b6b 100%);
            color: white;
        }

        .btn-warning {
            background: linear-gradient(135deg, #fcb69f 0%, #feca57 100%);
            color: #333;
        }

        .btn-info {
            background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
            color: #333;
        }

        .btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }

        input[type="file"] {
            display: none;
        }

        .video-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 20px;
        }

        .video-wrapper {
            position: relative;
            background: #f9f9f9;
            border-radius: 10px;
            padding: 10px;
            border: 2px solid #ddd;
        }

        .video-wrapper h3 {
            text-align: center;
            margin-bottom: 10px;
            color: #555;
        }

        .video-box {
            position: relative;
            width: 100%;
            background: #000;
            border-radius: 8px;
            overflow: hidden;
            min-height: 300px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        video, canvas {
            width: 100%;
            height: auto;
            display: block;
        }

        .selection-box {
            position: absolute;
            border: 2px dashed #4CAF50;
            background: rgba(76, 175, 80, 0.1);
            pointer-events: none;
            z-index: 10;
        }

        .placeholder {
            color: #999;
            font-size: 18px;
            text-align: center;
        }

        .settings {
            background: #f5f5f5;
            padding: 20px;
            border-radius: 10px;
            margin-bottom: 20px;
        }

        .setting-item {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
        }

        .setting-item label {
            min-width: 120px;
            font-weight: 500;
            color: #555;
        }

        .setting-item input[type="range"] {
            flex: 1;
            max-width: 300px;
        }

        .setting-item span {
            min-width: 50px;
            font-weight: bold;
            color: #667eea;
        }

        .progress-container {
            dis.........完整代码请登录后点击上方下载按钮下载查看

网友评论0