Luentotulkki - MIT-licenced private university lecture transcriber for Finnish

I made a convenience tool that did the video watching for me in my previous article: Ripped for your pleasure - this makes the pipeline a nice package for your convenience. Feel free to mod it and utilize it commercially, since it's a bunch of open source tools bunched together.

Kalle Tolonen
Sept. 3, 2026

This does about the same job as the Teams summary generator, but only to any video you have url/embedded access to. It has atm some hard coded prompts for my kind of 'lets get to the point already' optimizations for the summary/pdf generation, but you can ofc mod it to your needs.

It does capture and insert the slides too at the right time to what's discussed too, but publishing a pic of that would be copyright infringement, so I wont do that.

Example generated pdf page with details redacted from a lecture summary



Geeky stuff (how the magic happens)

1. Stream Ingestion & Resolving (`catch_stream.py`)
   - Reads the copied browser DevTools cURL command or URL directly from the clipboard.
   - Converts individual HLS chunk/segment URLs (`seg-*.ts`) into the master playlist (`index.m3u8`).
   - Extracts authentication headers (User-Agent, Referer, Cookie, Origin) and downloads the stream with FFmpeg.
   - Auto-numbers the target video sequentially (e.g., `03_luento.mp4`).

2. Slide Keyframe Extraction (`extract_slides.py`)
   - Scans the video stream using FFmpeg visual scene detection (`gt(scene, 0.15)`).
   - Extracts high-quality JPEG screenshots of each slide change (`slide_MMmSSs.jpg`).
   - Enforces a minimum time interval to avoid duplicate frames during animations.

3. Audio Preprocessing (`rip-transcribe.sh`)
   - Extracts audio track from the video file using FFmpeg.
   - Preprocesses audio for speech recognition: resamples to 16 kHz mono, applies a speech bandpass filter (75 Hz–7.5 kHz), and levels volume (`speechnorm`).

4. Metal GPU Transcription (`transcribe.py`)
   - Transcribes audio on Apple Silicon GPU using `mlx-whisper` (`whisper-large-v3-turbo`).
   - Matches slide timestamps with spoken speech and chronologically embeds slide tags: `![Dia (MM:SS)](...)`.
   - Generates three outputs: raw timestamped transcript (`.txt`), clean transcript (`_clean.txt`), and subtitle file (`.srt`).

5. 3-Pass Local LLM Editorial Pipeline (`Ollama` + `qwen3.6:35b-a3b`)
   - Pass A (Error Correction): Fixes phonetic transcription slips, typos, compound word errors, and spoken filler words (`_korjattu.txt`).
   - Pass B (Drafting): Synthesizes the lecture into a structured course summary with embedded slide placements.
   - Pass C (Academic Polish): Removes repetition, polishes language to formal Finnish academic prose, and enforces clear formatting for assignment requirements and deadlines.

6. Heading Deduction & Folder Packaging (`rip-transcribe.sh`)
   - Extracts the top-level topic `# <Otsikko>` from the LLM summary and converts it to a clean slug (e.g., `kyberturvallisuuden_johtaminen`).
   - Creates a dedicated folder: `${NUM}_${SLUG}/` (e.g., `03_kyberturvallisuuden_johtaminen/`).
   - Moves video, slides, all transcript formats, and Markdown into the folder.
   - Rewrites slide links to clean relative paths (`slides/slide_*.jpg`).

7. Vector PDF Rendering (`md_to_pdf.py`)
   - Cleans any remaining LLM thinking tags or terminal ANSI artifacts.
   - Converts Markdown to HTML with styled typography and slide figures.
   - Renders a publication-grade vector PDF directly inside the lecture folder using headless Chrome/Chromium (`--headless=new`).

Github available here.


Comments

No published comments yet.


Add a Comment

Your comment may be published.