TG Telegram Group Link
Channel: GeekTips
Back to Bottom
Converted tgs (telegram animated sticker) to svg (scalable vector graphic) animated stickers
copying svg files then search and replace to lazy load them and set size 512 x 512
adding new animated stickers to index
Filezilla to ftp upload svgs to website

+ indicates animated stickers have been uploaded to website
http://geektips.rf.gd/stickers/birds/goose/longgoose/
48h audiobook which is over 36h limit for 4GB wav file for whisper.cpp so split it up into two 24h opus audio then transcribed it to vtt

pysubs2 sub*.vtt -t srt
converts the two vtt subs to srt

durationa_1
shifting sub-seg2.srt subs by 86493.520 seconds
Which is 24h 1m 33s 520ms or 24:01:33.520

suba_1+2
appends sub-seg2.srt to sub-seg1.srt

pysubs2 msubs\(1\)+2.srt -t vtt
converts srt sub to vtt

rename msubs(1)+2.vtt to audiobook title and done.
awk script to run to detect any stuck subtitles

for f in *.vtt *.srt ; do printf "%s\n" "$f" ; awk -F ":" '/[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} -->/ {if ($2>$4 || $2<$4-1 ) print "        Line# "NR": " $1":"$2" "$4 }' "$f" | awk '!/59 00/' ; done

It'll print Line # with any duration more than 2 mins or if the last minute mark is less than the first minute mark.

audiobook17.vtt
Line# 19040: 04:09 56
Line# 22400: 04:56 10
Line# 82120: 18:27 29
Line# 82256: 18:29 27

first line the subs will stay on screen from 4h 9min until 4h 56m so the two 56 min marks need to be replaced with either 9 or 10..lemme check ok to a 10

4760
04:09:56.940 --> 04:56:39.090

He had returned to the Berghof, high above the little alpine town of Berchtesgaden,

4761
04:10:02.160 --> 04:10:09.170
on February 6, 1938. It was here that he always came when he had to ponder

So this will fix it
4760
04:09:56.940 --> 04:10:02.160

He had returned to the Berghof, high above the little alpine town of Berchtesgaden,

4761
04:10:02.160 --> 04:10:09.170
on February 6, 1938. It was here that he always came when he had to ponder

notice the modified end time is same as next start time 04:10:02.160 -->
Haven't used tailwind css for 2 months and 2 days. I modify website here and there but hadn't changed any styles so there was need to update css or rebuild css classes. Daisyui 3.0 just came out. Currently have collapsible categories by clicking on each one expands it and before you know it have 5 or 6 categories opened at once. On top and bottom of page click collapse all which is just refreshing the page. So decided to change to the new accordion which just keeps one open at a time. Remember this is pure css with no javascript.

https://daisyui.com/components/accordion/

npx tailwindcss -i ./src/input.css -o ./dist/geektips.css --watch --minify

So new svg animation index looks like so with the accordion http://geektips.rf.gd/stickers
I installed waydroid (android emulator) but couldn't get opus audio to play but that's an issue with this emulator and I know it works on android phones.

Followed instructions to install on Linux Mint (Debian)

then since it's X11 and waydroid is Wayland app had to install weston
sudo apt install weston

start it with this script each time
waydroid session stop && weston --fullscreen --shell=kiosk-shell.so --socket=wayland-0 &>/dev/null & sleep 5 && WAYLAND_DISPLAY=wayland-0 XDG_SESSION_TYPE=wayland waydroid show-full-ui

set up shared folder
sudo mount --bind ~/Audiobooks ~/.local/share/waydroid/data/media/0/Audiobooks

copied opus audiobook and vtt subs there to test.

downloaded apk for mpv-android then installed it
waydroid app install app-default-x86_64-release.apk
Can launch from Linux Menu in Other section
See more options here
https://mpv.io/manual/master/#subtitles

Tested quickly on a friend's android phone and mpv-android works with opus audiobooks. Chapters and subtitles. This should get you up and going. The other two free open source video players wouldn't play opus audio.
Sometimes whisper.cpp or even just whisper does hallucinations or repeating lines where it gets stuck in a loop. For this particular audiobook the way I fixed it was to re-encode all audiobook chapters to individual files. Used LosslessCut to remove the unwanted portion which consisted of a 5 or seconds of silence then sounded like a manual stop and restart with a foreign language reading of a title. Then merged those two back into one chapter then re-encoded the entire audiobook and the transcription was fixed.

VSCode has an extension think it's called Highlight Duplicates and it'll highlight dupes but still you need to visually browse through. Other extensions prints count number of dupes but then there isn't any line numbers. So trying to find a script online to detect duplicates and show the lines numbers is much harder than I thought especially if the lines are one after another as in subtitles since it would be every 3rd line.
Posting again as I've updated the awk script. Much better now only prints line numbers where the lines are 3 or 4 subtitle lines a way meaning much more likely to be hallucinating or repeating segments.

So found an awk script that does what I just turned into into a one-liner that's all

repeatsubs

for WebVTT subtitles

awk '{ x = lines[$0]["count"]++; lines[$0]["NR"][x] = NR; }END {fmt_s = "%sx %" max "-s %s\n\n"; for (i in lines) {if (lines[i]["count"] > 2 && lines[i]["count"] < 99) {for (j = 0; j < lines[i]["count"]; j++) {s = s lines[i]["NR"][j] ", ";} s = substr(s, 1, length(s) - 2); printf(fmt_s, lines[i]["count"], i, "\n" s ); s = "";}}}' *.vtt | awk -F, '$2 < $1+13' | grep -E -A1 '^[0-9]{,2}x' --color=always | less -r

for SRT subtitles

awk '{ x = lines[$0]["count"]++; lines[$0]["NR"][x] = NR; }END {fmt_s = "%sx %" max "-s %s\n\n"; for (i in lines) {if (lines[i]["count"] > 2 && lines[i]["count"] < 99) {for (j = 0; j < lines[i]["count"]; j++) {s = s lines[i]["NR"][j] ", ";} s = substr(s, 1, length(s) - 2); printf(fmt_s, lines[i]["count"], i, "\n" s ); s = "";}}}' *.srt | awk -F, '$2 < $1+13' | grep -E -A1 '^[0-9]{,2}x' --color=always | less -r
If there are more than 99 duplicates (like blank lines) it won't show those and must have at least 3 repeats. Modify if you need to.

Look for lines numbers that are relatively close to each other. Notice
4: Paris (190, 199, 208, 217) which aren't that far apart and it's repeating four times.

Also the first two show repeating
6: [ (181, 184, 187, 196, 205, 214)
4: ] (193, 202, 211, 220)

On lines 22149, 22152, 22155 we see it's stuck for a short bit 3 times repeating timecodes as seen in the screenshot above.
3: 07:19:37.300 --> 07:19:37.300 (22149, 22152, 22155)
This is what the output looks like and you can hopefully identity hallucinations in whisper.cpp
Tried out a bunch of linux distros ..most Arch-based. Archman is just a Manjaro deriative and it did detect my mac mini broadcom wireless. Arco Linux best if you want to install multiple desktop environments all at once and impressed with it's tweak tool.

The ones I'm most intrigued by are all ones that are non-systemd.

MX-Linux ...it was ok but nothing great. Good documentation. Still prefer Linux Mint to it and that's ultimately what I used due to being able to load wireless driver.

Void Linux will have to play around with this but just in a virtual environment. Like the philosophy of it.

Artix specifically dinit is the one I'm most impressed with. It was able to use wireless on live cd but not able to get wireless working again. Tried like crazy too.

Also will play around more with Arch Linux in a virtual environment.

All worked with ventoy except:

artix dinit...but artix s6 worked in ventoy
endeavorOS
MX-Linux
rebornos (I think)
This is GMIC stencil filter currently being used. You have to imagine all the strokes being animated since I'm not gonna post the svg animation. But it's what looks like after if finishes animating.

Stencil 226kB svg animation
fx_stencil 3,0,8,0,2,0,0,50,50
Huffman Glitches 550kB svg animation
fx_huffman_glitches 30,0,25,0,0,0,0,0,50,50
Random Plasma 596kB svg animation
samj_Random_Plasma 0,80
Neon 663kb svg animation
fx_neon 0,1,1,1,1,1.3,0.45,35.9,60.9,0,1,1.788,0,0,0,3,3.9,0.495,0.092,1.368,5,0.444,0.232,1.056,2,1,0,0,1,1,0,50,50
Hard Painting 459kB svg animation
fx_hard_painting 1,2.5,4,50,1,1,0,2,6,5,20,0,0.62,14,0,1,0.5,0.78,1.92,0,0,0,1,1,1,0.5,0.8,1.28,0,50,50
So I think I'll do Hard Painting filter for photos and stick with stencil for computer generated photos. Hard Painting filters is a tad bit more for the file size compared to stencil filter for svg animation but worth it I suppose. Looks kinda cool when animating. This one is 954kB as compared to the stencil which is 763kB.
HTML Embed Code:
2025/07/08 18:20:25
Back to Top