Professional Documents
Culture Documents
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Video Processing</title>
</head>
<body>
<input type="file" id="videoInput" accept="video/*">
<br>
<button onclick="startProcessing()">Start Video Processing</button>
<button onclick="stopProcessing()">Stop Video Processing</button>
<div id="videoContainer">
<video id="videoElement" controls></video>
<div id="frameContainer"></div>
</div>
<script>
let videoProcessing = false;
let frameInterval;
function startProcessing() {
// Get the selected video file
var videoInput = document.getElementById('videoInput');
var videoFile = videoInput.files[0];
if (!videoFile) {
alert('Please select a video file');
return;
}
// Create a video element and set its source to the selected video file
var video = document.getElementById('videoElement');
video.src = URL.createObjectURL(videoFile);
function stopProcessing() {
videoProcessing = false;
clearInterval(frameInterval);
}
function extractFrame(video) {
// Get the current date and time for folder naming
var now = new Date();
var folderName = now.toISOString().replace(/[:.]/g, '-');