BlackVideo Mini Player v2.4.0 — Standalone Mode, Sprite Preview, LLM Captions, Whisper Fix, Progress %, Auto-Updater #19
LoneStamp
started this conversation in
Show and tell
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
✅ What's in This Release
🖥️ Standalone Mode — Open Without a Video
The player can now be launched with no arguments and shows a welcome screen instead of exiting.
Before (v2.3.0):
After (v2.4.0):
▶icon, "Open a video or drop a file here" prompt, and an Open File button in the centre — all drawn in C viaui_overlay.cSDL_DROPFILEevent, requiresSDL_EventState(SDL_DROPFILE, SDL_ENABLE)at initplayer.adsgains aNo_Videostate alongsidePlaying/Paused/Stoppedmain.adbno longer exits on missing argument — passes""toPlayer.Runwhich entersNo_VideostateHow it works in Ada + C:
🖼️ Sprite Thumbnail Preview on Hover
Hovering the seek bar shows a small thumbnail of the video at that position, with a timestamp label beneath it.
How it works:
When a video opens, a background
cmd.exe /cjob (same WinExec pattern as Whisper) runs:This extracts one frame every 10 seconds as 160px-wide JPEG thumbnails and stores them in
build\cache\<video_hash>\. On a 90-minute film that is ~540 small JPEGs (~2–3 MB total), generated in roughly 10–20 seconds in the background.Hover rendering:
ui_overlay.ctracks mouse X over the seek bar and computeshover_pos = duration * (mouse_x - bar_x) / bar_whover_pos / 10→ loads the matching JPEG viaSDL_image(orstb_image— no extra DLL)New files:
src/thumb_cache.ads / .adb— Ada module: hash video path, check cache dir, launch ffmpeg job, map hover position → JPEG filenamecsrc/thumb_preview.c— C:SDL_Textureloading (viastb_image.h, header-only), draw popup boxCache location:
build\cache\<8-char-hash-of-video-path>\frame_%04d.jpgCleared by right-click → Clear Thumbnail Cache (new menu item).
⚡ Whisper Performance Fix — Why It Was So Slow
Root cause (the real problem):
whisper_bridge.adb'sGenerate()function callsC_System()(the Csystem()function) to run both ffmpeg and whisper-cli.C_Systemis fully synchronous — it blocks the calling thread until the command exits. ButLaunch_Whisperinplayer.adbcalls it viaWinExecwithcmd.exe /c "ffmpeg ... && whisper-cli ...".WinExecis nominally asynchronous but its behaviour withcmd.exe /c "..."on modern Windows is unreliable — the cmd shell can hold the process slot open or Windows Defender / real-time antivirus scans the newly created.wavand.srtfiles before releasing them, causing the job to appear stalled for minutes. Additionally,whisper-cliwith theggml-basemodel runs on CPU only and is genuinely slow: expect ~0.3× real-time on a mid-range CPU (a 60-second video takes ~3–5 minutes, not hours — something else is wrong).The real culprits causing "hours":
.wavand.srtfile whisper-cli writes. On some machines this causes 100% disk hold for the duration.WinExec+cmd.exe /cwith a long quoted string — Windows has a 8191-char limit oncmd.execommand lines. If the video path is long, the command silently truncates and whisper-cli never starts — butWinExecreturns success (≥ 32) andWhisper_RunningstaysTrueforever, showing "generating..." permanently.ggml-basemodel is genuinely slow for long content. A 2-hour film can take 30–60 minutes on CPU.Fixes in v2.4.0:
WinExecwithCreateProcess— proper async process launch with aPROCESS_INFORMATIONhandle we keep alive and poll withGetExitCodeProcess(hProcess, &code); code == STILL_ACTIVE. This is reliable on all Windows versions and not affected by the cmd.exe quoting issues..donefile — at the end of the whisper batch,echo done > <out>.done.Check_Whisper_Donepolls for the.donefile, not the.srt, so we know the SRT is fully written before loading it..batfile in%TEMP%andCreateProcessrunscmd.exe /c that.batinstead. No truncation.Whisper_Runninghas been true for > 30 minutes with no.donefile, the status banner changes toWhisper: stalled? Check Defender / consoleand a[Whisper] TIMEOUTmessage is printed to console.WHISPER_SETUP.mdupdated with the Windows Defender exclusion path recommendation.New Ada/C additions:
📊 Whisper / LLM Progress Percentage
Instead of a static
Whisper: generating..., the status banner now shows a live percentage:How whisper-cli outputs progress:
whisper-cliwrites progress lines to stderr in the form:Implementation:
bv_create_processis replaced withbv_create_process_with_pipewhich creates a read pipe on stderr of the child process (usingCreatePipe+STARTUPINFO.hStdError = write_end)Check_Whisper_ProgresscallsPeekNamedPipe(non-blocking) to read any available stderr bytes, scans for theprogress = NN%pattern, and callsUI_Overlay.Set_Whisper_Status("Whisper: generating... NN%")Same pipe approach applies to LLM providers that stream token output (see below).
🤖 LLM Cloud Caption Generation
Six cloud providers available from the context menu — right-click → Generate Captions (LLM) ▶ → sub-menu:
claude-sonnet-4-5gpt-4o-audio-previewgemini-1.5-prodeepseek-chatgrok-2Architecture — two-step approach (no audio upload for text-only providers):
ggml-tiny.srtwhich is auto-loaded into Track 2For OpenAI and Gemini which support native audio, step 1 is skipped and the WAV is uploaded directly.
API key storage —
%APPDATA%\BlackVideo\keys.cfg:First use: context menu shows Set API Key for [Provider] — a small SDL2 text input overlay appears (drawn in C). Keys are written to
keys.cfgand reused on subsequent sessions.HTTP in Ada + C:
csrc/llm_client.c— usesWinINet(available on all Windows, no extra DLL) for HTTPS POST. No libcurl dependency.src/llm_bridge.ads / .adb— Ada wrapper:Send_Request(Provider, Transcript, Duration)→ returns raw SRT stringInternetReadFileloop, status banner updated with token count:Claude: generating... 142 tokensNew context menu layout:
🔔 Auto-Updater — GitHub Release Check
On every launch, the player silently checks
https://raw.githubusercontent.com/BlackBlazent/blackvideo-mini-player/main/latest.jsonusingWinINet. If theversionfield is newer than the compiled-in version string, a notification badge appears on the⋮menu button.latest.jsonformat (add to repo root):{ "version": "2.4.0", "release_url": "https://github.com/BlackBlazent/blackvideo-mini-player/releases/tag/v2.4.0", "download_url": "https://sourceforge.net/projects/blackvideo-mini-player/files/blackvideo-mini-player-v2.4.0.win.zip/download", "notes": "Standalone mode, sprite preview, LLM captions, Whisper fix" }Context menu → Check for Updates... shows a small SDL2 overlay:
Clicking Download opens the
download_urlin the default browser viaShellExecuteA.How version comparison works:
On launch: check is done asynchronously via
CreateThreadso it never delays startup. Result is stored in a global; the menu badge is drawn on the next frame after the thread completes.📁 New Files in This Release
src/thumb_cache.ads / .adbsrc/llm_bridge.ads / .adbsrc/updater.ads / .adbcsrc/thumb_preview.cstb_image.hJPEG loadcsrc/process_helpers.cCreateProcess+ pipe helpers replacingWinExeccsrc/llm_client.cinclude/stb_image.hlatest.json%APPDATA%\BlackVideo\keys.cfg🔧 Modified Files
src/player.adbNo_Videostate,SDL_DROPFILE,CreateProcesswhisper launch, progress pipe polling, updater thread start, LLM dispatchsrc/player.adsNo_Videostate inPlayer_Stateenumsrc/main.adb""on no argssrc/ui_overlay.ads / .adbcsrc/ui_overlay.csrc/whisper_bridge.adbGenerateusesCreateProcess+ pipe; sentinel.donefile; path-length guard; timeout detectionscripts/build.batprocess_helpers.c,thumb_preview.c,llm_client.c; defineSTB_IMAGE_IMPLEMENTATIONscripts/build.shblackvideo_player.gpr.ofiles to linker; add-lwininetfor Windows🎮 Updated Controls
Context Menu
build\cache\for this video📦 New Requirements (Windows)
All existing DLL requirements from v2.3.0 remain. No new DLLs required:
stb_image.his header-only — compiled directly intothumb_preview.cWinINetis part of Windows (wininet.dll) — already present on all Windows 10/11CreateProcessis part ofkernel32.dll— no new importNew linker flag added to GPR:
-lwininetBuilt with Ada 2012 · FFmpeg 8.x · SDL2 · SDL2_ttf · whisper.cpp · WinINet · GNAT Community 2021
Full Changelog: v2.3.0...v2.4.0
This discussion was created from the release BlackVideo Mini Player v2.4.0 — Standalone Mode, Sprite Preview, LLM Captions, Whisper Fix, Progress %, Auto-Updater.
All reactions