diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-17 14:36:47 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-17 14:36:47 +0100 |
| commit | 82e74d8eb80ae5778b929e2074d2735d40f710ca (patch) | |
| tree | 169846de917cfb021c4ee1a1f1278796b9ad3d8a /examples/tools/test-video.sh | |
| parent | 27a673d4504b77b47986247cdaf3e3bd41f67c15 (diff) | |
| download | desktop-assistant-82e74d8eb80ae5778b929e2074d2735d40f710ca.tar.gz desktop-assistant-82e74d8eb80ae5778b929e2074d2735d40f710ca.zip | |
tools: video, collapse whisper's repeated words; live check
whisper turbo repeats words, often across two segments ("it's it's"),
and loops over intro music: a word said twice in a row collapses to
one, after the segments are joined. A transcript that fits the
preview is labelled "full text"; the description forbids summarizing
from the start alone. Live check findings in AGENTS.md: 0.18x real
time on a real talk, stop kills whisper in 0.07 s, a summary works
from the attached file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'examples/tools/test-video.sh')
| -rwxr-xr-x | examples/tools/test-video.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/tools/test-video.sh b/examples/tools/test-video.sh index 55a16d3..cca1aeb 100755 --- a/examples/tools/test-video.sh +++ b/examples/tools/test-video.sh @@ -73,6 +73,16 @@ check "own tmp removed" "$(command ls -d "$XDG_RUNTIME_DIR"/video-* | wc -l)" 1 out=$(v "$tmp/Hello Clip.mp4") contains "collision" "$(head -1 <<<"$out")" "$ASSISTANT_DIR/hello-clip-2.md " +# Words whisper repeats collapse; a stand-in whisper writes them. +mkdir -p "$tmp/wbin" +printf '%s\n' '#!/bin/bash' 'while [ $# -gt 0 ]; do [ "$1" = -of ] && of=$2; shift; done' \ + "printf ' Revis Revis Revis Good morning.\\n three themes themes, running\\n running through it.\\n' > \"\$of.txt\"" \ + > "$tmp/wbin/whisper-cli" +chmod +x "$tmp/wbin/whisper-cli" +PATH=$tmp/wbin:$PATH v "$tmp/Hello Clip.mp4" >/dev/null +contains "dedupe" "$(cat "$ASSISTANT_DIR/hello-clip-3.md" 2>/dev/null)" \ + "Revis Good morning. three themes, running through it." + # Refusals: one error line, exit 1, nothing written. before=$(command ls "$ASSISTANT_DIR" | wc -l) out=$(v "$tmp/silent.mkv"); check "no audio rc" $? 1 @@ -116,6 +126,7 @@ check "subs no note" "$(grep -c 'comment\|spans' <<<"$md")" 0 sed 's/$/\r/' "$tmp/it.vtt" > "$tmp/crlf.vtt" out=$(STUB_META=$'125\tFalse\tNA\tCRLF' STUB_VTT="$tmp/crlf.vtt" v "https://example.org/v/9") md=$(cat "$ASSISTANT_DIR/crlf.md" 2>/dev/null) +contains "short full" "$out" $'\nfull text:\n' contains "crlf text" "$md" 'Ciao a tutti & benvenuti Oggi parliamo di Slackware.' check "crlf no cue ids" "$(grep -c '^[0-9] \| 2 ' <<<"$md")" 0 @@ -143,6 +154,7 @@ contains "no length, long" "$out" "long: Long reel, 31:00." { printf 'WEBVTT\n\n'; for i in $(seq 400); do printf '00:00:%02d.000 --> 00:00:%02d.500\nline number %d of the talk.\n\n' $((i % 60)) $((i % 60)) "$i"; done; } > "$tmp/big.vtt" out=$(STUB_META=$'600\tFalse\ten\tBig Talk' STUB_VTT="$tmp/big.vtt" v "https://example.org/v/6") contains "big path" "$(head -1 <<<"$out")" "big-talk.md (2400 words" +contains "big start only" "$out" "start, not the whole text" check "big under cap" "$(( ${#out} < 2000 ))" 1 para=$(awk 'NR > 5 && NF' "$ASSISTANT_DIR/big-talk.md" | head -1) check "paragraph joined to a sentence end" "$(( ${#para} > 400 && ${#para} < 440 ))" 1 |
