Preload audio as Blob for instant seeking; generate Opus playback file; delete original upload after extraction
Some checks failed
Build and Push / build (push) Has been cancelled
Some checks failed
Build and Push / build (push) Has been cancelled
- Download full audio as Blob on mount so seeking is instant (no network range-requests) - Remove readyState guard from playAt() that was silently blocking seek attempts - Add disabled/ready state to SessionReel for reliable click-to-seek - Generate 48kbps Opus playback file during extraction (~65MB for 3hrs vs 1.5GB lossless) - Serve Opus first in audio endpoint, then original upload, then extracted WAV - Delete original upload after successful transcription to reclaim storage - Reorder extract_audio checks so retry works without the original file - Fix Back links on Speakers and Notes pages to go to home
This commit is contained in:
@@ -8,7 +8,7 @@ from fastapi import APIRouter, UploadFile, File, Form, HTTPException
|
||||
from .. import database as db, config, jobs
|
||||
from ..config import merge_campaign_settings_with_env
|
||||
from ..errors import PipelineError
|
||||
from ..pipeline.audio import extract_audio
|
||||
from ..pipeline.audio import extract_audio, generate_playback_audio
|
||||
from ..pipeline.transcribe import transcribe_and_diarize
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ def _run_transcription(session_id: str, video_path: Path, audio_path: Path, tran
|
||||
progress_cb("Extracting audio...")
|
||||
try:
|
||||
extract_audio(video_path, audio_path)
|
||||
generate_playback_audio(video_path, audio_path.with_suffix(".opus"))
|
||||
transcribe_and_diarize(
|
||||
audio_path,
|
||||
transcript_path,
|
||||
@@ -114,6 +115,16 @@ def _run_transcription(session_id: str, video_path: Path, audio_path: Path, tran
|
||||
(str(audio_path), str(transcript_path), session_id),
|
||||
)
|
||||
|
||||
# Original upload no longer needed — Opus serves playback, WAV serves
|
||||
# re-transcription. Reclaim storage.
|
||||
if video_path.exists():
|
||||
try:
|
||||
video_path.unlink()
|
||||
with db.tx() as conn:
|
||||
conn.execute("UPDATE sessions SET video_path = NULL WHERE id = ?", (session_id,))
|
||||
except OSError:
|
||||
pass # non-fatal
|
||||
|
||||
job_id = db.create_job(session_id, "transcribe")
|
||||
jobs.submit(job_id, run, requires_gpu=True)
|
||||
return job_id
|
||||
|
||||
Reference in New Issue
Block a user