This document outlines the implementation of job progress tracking for video summarization tasks in the SVS application.
The system now tracks the progress of video processing jobs, allowing users to monitor the status of their video summarization requests in real-time through the dashboard.
-
Job Management (backend/app/api/admin_routes.py)
- In-memory storage for active and completed jobs
- Functions for registering, updating, and completing jobs
- REST API endpoints for job management:
/api/admin/jobs- List all jobs/api/admin/jobs/<job_id>- Get specific job details/api/admin/jobs/<job_id>/progress- Update job progress
-
Video Processing (backend/app/summarizer/routes.py)
- Job creation with unique IDs for each summarization request
- Background thread processing with progress callback
- Stage-based progress reporting (audio extraction, transcription, summarization)
-
Progress Callback (backend/app/summarizer/processor.py)
- The
process_videomethod accepts a progress callback function - Different stages report progress individually
- The
- Dashboard UI (backend/app/static/js/dashboard.js)
- Jobs page displaying active and completed jobs
- Real-time progress bars for active jobs
- Auto-refresh with configurable intervals (3 seconds for jobs, 30 seconds for other pages)
A test script is provided to demonstrate the progress tracking functionality:
# Run the test script with a video file
python backend/test_summarize_with_progress.py --video path/to/video.mp4The script will:
- Check if the API is running
- Create a summarization job
- Poll for progress updates
- Display the final summary when complete
The video processing is divided into stages, each with weighted progress contributions:
- Audio Extraction (20%): Converting video to audio
- Transcription (50%): Converting audio to text
- Summarization (30%): Generating the summary from text
- Progress updates are pushed to the dashboard in real-time
- Failed jobs are properly marked and tracked
- Job history is maintained for completed jobs (up to 20 most recent jobs)
- Progress is normalized to a 0-100% scale for consistency