How jpistone/notwhatisaid works
• Downloads a YouTube video via a user-provided URL (using pytube).
• Processes the video’s audio with OpenAI’s Whisper (via whisper-timestamped) to generate a word-level timestamped transcript.
• Serves a web interface—built using Flask for the backend and HTML/CSS/JavaScript (with responsive design) for the frontend—that displays the video alongside a synchronized, interactive transcript.
And Label Main Components
• Frontend Client:
• Web Browser/User Interface displaying the video and transcript.
• Static assets: HTML templates (found in yt_whisper_sync/templates), CSS, and JavaScript files (in yt_whisper_sync/static/js and /css).
• Backend Server:
• The Flask Application (mainly defined in yt_whisper_sync/app.py, __main__.py, and run.py). This component handles HTTP requests, routing, and rendering views.
• API Endpoints that accept the YouTube URL, trigger video downloading, and respond back with the transcript data.
• Video & Audio Processing Module:
• The YouTube downloader that uses pytube to fetch video and audio.
• The transcription service that leverages whisper-timestamped to generate synchronized timestamps.
• A module (possibly encapsulated in yt_whisper_sync/benchmark.py or setup code in run.py) for processing benchmarks, emphasizing performance metrics.
• External Dependencies:
• FFmpeg (installed on the host machine, as noted in the README, which is essential for audio extraction/processing).
• Dev/Deployment Tools:
• Docker configuration files (inside .devcontainer), which indicate that developers can use a containerized environment to run the project.
• Setup and requirements files (setup.py and requirements.txt) ensure reproducibility.
Interactions and Data Flow
• Flask Backend splitting the work:
• One branch sends the URL to the “YouTube Downloader” component (and then funnels the video/audio into processing).
• Another branch handles rendering the web page (delivering the HTML/CSS/JS assets).
• The “YouTube Downloader” uses pytube to fetch the video and downloads it to the server’s file system (note: the README mentions that uploads and processed videos are stored in a designated static folder).
• The “Transcription Service” (using whisper-timestamped and FFmpeg for audio extraction) then processes the downloaded video’s audio, generating a transcript with word-level timestamps.
• The generated transcript is then sent back to the Flask backend which renders it on the client side. JavaScript in the frontend synchronizes the transcript highlighting with the video’s playback.
Architectural Patterns, Technologies, and Design Principles
• Modular Python Design: The project is organized as a Python module (yt_whisper_sync) with clearly separated responsibilities (video processing, benchmarking, and serving views). This modularity is crucial and should be emphasized.
• MVC-like Separation: Although not strictly MVC, the separation between "views" (HTML templates), "controller logic" (Flask routes in app.py) and "data/service" layers (download and transcription processing) is a central architectural idea.
• External Service Integration: Note the use of external libraries (pytube, whisper-timestamped) and external tools (FFmpeg).