Web UI Overview
The Video Analyzer UI is a lightweight web interface built with Flask that provides a graphical front-end for the core video-analyzer
command-line tool. It simplifies the process of analyzing videos by offering an intuitive interface for users who may prefer not to work with the command line.
Features
- Simple Interface: A clean, single-page application for straightforward video analysis.
- Drag-and-Drop Upload: Easily upload videos by dragging them onto the page or using a standard file selector.
- Full Configuration: Access and configure all the major command-line options directly in the browser.
- Real-time Command Preview: See the exact CLI command that will be executed based on your selected options.
- Live Output Streaming: Watch the analysis progress in real-time as the command output is streamed directly to the browser.
- Results Download: Once the analysis is complete, you can download the final
analysis.json
file with a single click. - Session Management: Each analysis runs in an isolated temporary session to prevent conflicts, with automatic cleanup to manage disk space.
How It Works
The UI acts as a wrapper around the CLI tool. The workflow is as follows:
- Upload Video: You upload a video file, which is temporarily stored in a unique session directory on the server.
- Configure Analysis: You fill out a form with the desired analysis parameters (e.g., model, prompt, max frames).
- Run Analysis: The Flask server constructs the full
video-analyzer
command based on your settings and executes it as a subprocess. - Stream Output: The server captures the standard output and standard error from the subprocess and streams it to your browser using Server-Sent Events (SSE), providing a live view of the progress.
- View Results: After the process completes, the UI provides a button to download the
analysis.json
file, which is retrieved from the session's results directory.