Spaces:
Running
Running
Commit History
-
fix: crash + data-loss bugs from the audit (transcript parsing, download headers)
ClaudeFour confirmed crash/data-loss findings: transcript.py: * IndexError when a cue's text starts with '.' — the sentence-boundary check did prefix.rsplit(None,1)[-1] on an empty prefix ([] → [-1] raises). A leading-period cue is common in auto-transcripts. Guard the empty-prefix case. * Hourless WebVTT timestamps (mm:ss.ttt — valid per spec, common for sub-hour clips) matched none of the HH:MM:SS-only regex and produced ZERO cues — the whole transcript silently ignored. Make the hours group optional; SRT (always hours) still matches. * Trailing cue whose midpoint lands at/after the computed tail edge (video duration undershot the final cue's end) matched no bucket window and was dropped from both narration text and sliced audio. Spill it into the last segment — symmetric to the existing head spill. main.py: * A title with non-latin-1 alphanumerics (CJK, emoji, some accented letters — _safe_filename keeps them because "中".isalnum() is True) reached Content-Dispositi…4f70b55
-
transcript: spill pre-first-boundary cues into the first segment
ClaudeDeselecting the first topic in the topic-preview flow left the new first kept segment starting well after the transcript did (e.g. the surviving boundaries become [180s, ...] for a transcript that began at 0s). _bucket_cues only matched cues whose midpoint fell inside some [edges[i], edges[i+1]) window, so the opening narration was silently dropped — several minutes of speech vanishing with no error. Spill cues with midpoint < edges[0] into bucket 0 instead. The audio slicer (cue_bounds_per_segment) shares the same bucketing, so its first segment's bounds extend backwards in lockstep and the dropped narration is recovered in audio too. In the common case where the transcript begins at the same time as the first kept segment, this is a no-op. https://claude.ai/code/session_01EM8jiYxdVFy1w3LeJ9GBJgf16b33f -
Stitcher: add lowercase-continuation fallback for transcripts without periods
ClaudeUser report: a topic boundary fell mid-sentence on a lecture whose Whisper transcript omits terminal punctuation entirely. The stitcher's terminator-split strategy needs at least one .!? somewhere in B's first cues — when none exists, it gave up and the cut stayed. Add a second strategy that uses casing as the signal: if B's first cue starts with a lowercase letter, it's almost certainly continuing A's open sentence. Absorb consecutive lowercase-starting cues into A until we hit one that starts with a capital (next sentence begins) or the existing _MAX_SENTENCE_ABSORB_CUES cap. Triggers only after the terminator strategy has been tried and failed, so behaviour on punctuated transcripts is unchanged. Guarded edge case: when B opens with a capital letter, we don't move cues — the mid-sentence cut is on A's side (transcript dropped a period) and pulling B-cues into A would just mash two real sentences together. Two tests pin both branches; the heat-pump "how to install / and maintain" s…39c2e46
-
fixing split
169b4ab -
fixing splicer
31770ae -
Stitcher: absorb lone terminator cue from B when it completes A's sentence
ClaudeThe previous stitcher refused to absorb if doing so would empty segment B — but in real transcripts the case where B has just one cue that completes A's trailing sentence is exactly when absorption matters most. Without it, A still ends mid-sentence (e.g. "...so here in the Boston") and B opens with the orphaned completion ("area, heat pumps stay viable."), defeating the whole point of the fix. Replace the per-cue greedy loop with a lookahead: only absorb when a terminator-ending cue is reachable within MAX_SENTENCE_ABSORB_CUES from B's start, then move that whole prefix at once. Partial absorption that doesn't actually complete a sentence is skipped, since it would just relocate the mid-sentence cut without fixing it.816dd45 -
Stitch sentences across scene boundaries so narration isn't split
ClaudeA single sentence often spans two consecutive transcript cues. When a scene boundary falls between them, the cues bucket into different segments by midpoint and the rendered narration shows the sentence truncated mid-clause in segment A and re-opening mid-sentence in segment B. After the initial cue bucketing, walk adjacent segment pairs: if segment A's last cue ends without sentence-terminating punctuation, absorb cues from segment B's start until A ends a sentence. Cap the move at 3 cues and never empty out segment B so a transcript with no terminal punctuation can't pull everything into the first bucket. The audio-bounds helper sees the stitched buckets too, so per-segment clips extend with the absorbed cue and stay aligned with the text.23524b2 -
Snap per-segment audio bounds to whole cues so clips don't end mid-sentence
ClaudeAudio slicing used each scene's [start_seconds, end_seconds) verbatim, but scene-change timestamps rarely fall on sentence boundaries — clips routinely cut mid-word at the start and mid-sentence at the end. Add cue_bounds_per_segment in transcript.py: for each segment, return the first-cue-start / last-cue-end of the cues align_segments already bucketed into it. The orchestrator now extends each slice outward to those bounds so the clip contains the full sentences whose text is shown under the segment, falling back to the scene bounds when no cue landed in the bucket.cae500e -
Anchor transcript alignment to video duration so guides cover full video
ClaudeThe orchestrator computed total_duration as max(f.end_seconds for f in kept) — the end of the last kept visual frame. When trailing scenes were dropped (instructor-only wrap-up shot, max_frames cap, scene- detect undershoot), every transcript cue past that point was silently discarded by align_segments because no bucket covered it. Use the actual video duration as the right edge for transcript alignment so trailing narration is attached to the last kept segment, and extend that segment's end_seconds to match so its displayed time range reflects the content it now covers. Promote _video_duration to a public helper since the orchestrator now imports it.410a4b8
-
Format narration into paragraphs
Claudealign_segments now groups cues into readable paragraphs, breaking on (a) cue gaps >= 1.5s when the prior cue ended a sentence, (b) speaker labels like "PROFESSOR:" introducing a new cue, or (c) accumulated length >= 450 chars at a sentence boundary. Segment.narration is now a list[str], rendered as one <p> per paragraph. In review mode, the narration body is a contenteditable container with <p> children, so pressing Enter creates new paragraphs naturally. Save/load JSON preserves the array structure, and the downloaded final HTML keeps the paragraph breaks. On the test video, the previously single-paragraph 7-minute final segment now reads as 10 paragraphs. https://claude.ai/code/session_01G3XpEehfr9DnX9L7BahQ4Lf697ee6 -
Build initial VideoGuideMaker MVP
ClaudeFastAPI web app that turns an instructional video plus VTT/SRT transcript into a WCAG 2.2 AA-ready HTML study guide. Pipeline: PySceneDetect + OpenCV for scene detection and frame sampling, Haar-cascade face detection to drop talking-head frames, Tesseract OCR for on-screen text, timestamp-based narration alignment, Jinja2 template with proper landmarks, headings, lang, skip link, time elements, and data-alt-draft="true" flags on auto-drafted alt-text. Output is either a self-contained HTML file (base64-inlined images) or a zip bundle (HTML + images/ folder). Includes unit tests for the transcript parser and HTML generator. https://claude.ai/code/session_01Q9yxSTNAMqkjcYLDJAbV3Zb6f361a