multilang-asr-captioner / static /transcribe_video.html
marquesafonso's picture
add validation for other video formats; double cache size; adapt to device_type change in transcriber
fc6dd1b
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" integrity="sha512-Fo3rlrZj/k7ujTnHg4CGR2D7kSs0v4LLanw2qksYuRlEzO+tcaEPQogQ0KaoGN26/zrn20ImR1DfuLWnOo7aBA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<title>Transcribe Video</title>
<style>
body { font-family: Arial; background: #f0f0f0; padding: 2rem; }
form { background: white; padding: 2rem; border-radius: 10px; max-width: 600px; margin: auto; }
label, select, input { display: block; width: 100%; margin-bottom: 1rem; }
input[type="submit"] { background: #4CAF50; color: white; padding: 0.8rem; border: none; cursor: pointer; }
.radio-container { display: flex; gap: 2rem; margin-bottom: 1rem;}
.radio-option { display: flex; flex-direction: column; align-items: flex-start;}
</style>
</head>
<body>
<form id="video-form" action="/transcribe/" method="post" enctype="multipart/form-data" onsubmit="submitButton.disabled = true; return true;">
<h2>Step 1: Upload & Transcribe</h2>
<label for="video_file">Video File</label>
<input type="file" name="video_file" id="video_file" required>
<label for="task">Task</label>
<select name="task" id="task">
<option value="transcribe">Transcribe</option>
<option value="translate">Translate</option>
</select>
<label for="model_version">Model Version</label>
<select name="model_version" id="model_version">
<option value="deepdml/faster-whisper-large-v3-turbo-ct2">faster-whisper-large-v3-turbo</option>
<option value="turbo">turbo</option>
<option value="large-v3">large-v3</option>
</select>
<label for="max_words_per_line">Max words per line</label>
<input type="number" name="max_words_per_line" id="max_words_per_line" value="6">
<label for="device_type">Device Type</label>
<select name="device_type">
<option value="desktop">Desktop</option>
<option value="mobile">Mobile</option>
</select>
<div id="loading" style="display:none; text-align: center; margin-top: 10px; margin-bottom: 10px; font-weight: bold;">
<i class="fas fa-spinner fa-spin"></i> Processing, please wait...
</div>
<input type="submit" name="submitButton" value="Transcribe">
</form>
<script>
// Show loading spinner on submit
document.getElementById('video-form').addEventListener('submit', function () {
document.getElementById('loading').style.display = 'block';
});
</script>
</body>
</html>