PowerPoint: render .pptx to MP4 with animations (fallback: slide images) #189
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage#189
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split from #33 at the product owner's request (GRI-1960, 2026-11-14): work due for the campus test on Monday 16 Nov moves off voidgazer to a faster agent.
What
A
.pptxupload becomes one H.264 MP4 that keeps slide transitions and animations. The users want PowerPoint only for the animations (PO, GRI-1967).Approach from #33: LibreOffice Impress slideshow on Xvfb, recorded with ffmpeg, at screen resolution. The player already plays video (
crates/client/src/renderer/video.rs, GStreamerplaybin), so this does not wait on #39.Fallback
If the render fails or times out, keep the slide images from #33 (step 1:
soffice --convert-to pdf, then the PDF page path). Voidgazer has that slice done locally and pushes it as a PR on #33. Build on it; do not rewrite it.Done when
#[ignore].Implemented, PR #190.
What:
.pptxupload renders to one H.264 MP4 (LibreOffice Impress on a virtualXvfbdisplay, recorded withffmpeg), using the deck's own slide timing. A deck with only click-triggered steps never finishes on its own (nobody to click a screen), so the render is bounded by a configurable timeout and falls back to one PNG per slide — the shape #33 already produces (soffice --convert-to pdfthengs) — so a failed or timed-out render never leaves a half item. Every binary, the resolution and the timeout are configuration (PptxVideoConfig, GRI-1884), not hard-coded.Open finding, for the record: on this build host, a real Impress slideshow window renders blank under
Xvfb— confirmed by reading the raw framebuffer directly, bypassingffmpeg/x11grab, across every combination of window manager, Skia/OpenGL toggles and dialog suppression I tried. The mechanism (Xvfb + fluxbox + soffice --show + ffmpeg x11grab) produces a valid, non-trivial MP4 container; its content is uniform. Best guess, unconfirmed: this account is in neither thevideonorrendergroup that owns/dev/dri/card1/renderD128, which may be starving even the software (llvmpipe) raster path. I could not isolate it further in this run.This does not block the fallback — it is real and tested end-to-end with the real
soffice/gsbinaries — but it does mean real animation/transition fidelity on campus decks (the remaining part of #33) is not yet verified on this host. Flagging for@nexus-warden/ infra: worth checkingvideo/rendergroup membership on the runner before relying on the video path for Monday, otherwise the fallback (slide images) is the safe assumption for the campus test.Verified:
cargo test -p server --lib pptx_video(fake-tool unit tests, no real X11 needed),cargo test -p server --test pptx_video_acceptance_integration(real HTTP round trip — fallback exercised with realsoffice+gs; the success path uses injected fake tools given the finding above), fullcargo test --workspace --all-targets --locked(no regressions),cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo deny check.Pushed
c466099: fixes the redcargo teston #190.1. CI test fix.
a_pptx_render_that_fails_falls_back_to_one_page_image_per_sliderelied onPptxVideoConfig::default()'s realsoffice/gsto drive the fallback conversion. That passes on this build host (both are installed) but the CI runner image has neither, so it failed there with no hint in the forge job log. Swapped in a fakesoffice/gspair — same patternpptx_video.rs's ownfallback_returns_pages_in_page_orderunit test already uses — so the test proves the real HTTP round trip and the real fallback code path without needing either binary.cargo test --workspace --all-targets --lockedis green locally (./scripts/local-gates.sh --rust-only, exit 0).2. The #191 slide-image reuse. Not done yet: #191 (GRI-2011) is still open and in
CONFLICTstate againstdev, so there is nothing to call yet. Once it lands I'll mergedev, pointrender_fallback_pages's output at itsdocument/document_pagepath, and drop thegsrasterizer here. Flagging so this doesn't get missed — will pick it back up when #191 merges.3. The blank-render finding, extra checks as asked.
Tried, with real
soffice/Xvfb/fluxboxon this host (not CI):SAL_USE_VCLPLUGIN=gen SAL_DISABLEGL=1withsoffice --norestore --show, sameXvfb/profile setup as the production path.import -window root(xwd/xwininfoaren't installed here,import/convertare) rather than going throughffmpeg.Result: the captured frame shows a normal Impress edit window titled
deck.pptx — LibreOffice Impress, blank/gray canvas — not a fullscreen slideshow. So--showis not reaching a presentation view at all under this setup, llvmpipe/GL aside. Separately,fluxboxreproducibly exits "Aborted (core dumped)" the moment it's sentSIGTERMunder this Xvfb (every run, both before and after theSAL_*changes) — so the window manager that is supposed to size/place the slideshow window may not be reliably alive for the full duration of a real render. I did not get further than that in the time I had; haven't tried running fluxbox under e.g.gdb/core-dump inspection, and haven't tried a WM-less--showwith a forced geometry.Worth noting since it changes the likely cause: this looks less like a
/dev/dripermissions problem (libEGL warning: failed to open /dev/dri/card1: Permission deniedis present but llvmpipe doesn't need it, same as you said) and more like--showplus thisfluxboxeither not managing the window in time, or the slideshow window needing somethingfluxbox's crash is taking with it. Handing this to the CTO/infra per the original flag — I don't think I can resolve the window-manager instability from inside this crate's test harness, and it's the same real-render-fidelity gap already called out, not a new blocker for the fallback.video/rendergroup membership on this account is still absent (id: groups areaetherforge,grimoirix;/dev/dri/card1andrenderD128are groupvideo/render), unchanged from before.@aetherforge one item moves here from #33. PR #190 already does the server side of #191 (soffice -> PDF -> pages fallback,
400 invalid_pptx), so #191 is closed as superseded. The one part #190 does not have is the front end:frontend-web/src/screens/MediaScreen.tsxline 214 still hasaccept="image/*,video/*,application/pdf", so the upload dialog does not offer a .pptx. Please add.pptx(andapplication/vnd.openxmlformats-officedocument.presentationml.presentation) to #190, with the test change #191 made inMediaScreen.test.tsx. The fidelity report asked on #33 (per effect: correct / different / missing, click steps, render time and peak memory) also lives here now; it waits on the blank-render finding.@aetherforge #190 is merged into
dev(headafa63c6, all required checks green;cargo deny advisoriesis red ondevtoo and not required). Thank you.This issue stays open, because the reason for it is not done yet: the animations. On this host a real Impress slideshow still renders blank, so
render_output_is_blanknow catches it and every real deck falls back to slide images. The fallback is correct, but the campus wants PowerPoint only for its animations.Your one item now, on this issue:
soffice --showstays in the edit window, so the slideshow never starts full-screen. Try starting the show differently (for example a.ppsxcopy, or-showwith--norestore --nologoand a fresh-env:UserInstallationprofile) and check the framebuffer.Push a fix as a new PR to
dev. Forge CI is the gate.1. Real decks render visible frames now
Root cause found:
soffice --show <file>started the slideshow before thetoolkit had finished initializing. On this host (no
/dev/dri—video/rendergroup membership absent) that left the presentation windowpermanently unpainted — reproducible on every attempt, with any combination
of
SAL_DISABLE_OPENGL/SAL_DISABLE_SKIAenv vars, every time.Fix (PR open against
dev):--show) and wait for its firsttop-level window instead of assuming it is ready.
XTESTextension — the same thing aperson would press — rather than asking for the slideshow on the command
line.
(
DisableOpenGL/UseSkia/ForceSkiaRasterfuses). Without this, F5still got stuck on the desktop background instead of the slideshow.
This is
crates/server/src/bin/pptx_video_presenter.rs, a small Rust binary(pure-Rust
x11rb, no new host package) thatrender_to_mp4now shells outto the same way it shells out to
soffice/ffmpeg/Xvfb/gs. It tracksthe slideshow via the EWMH
_NET_WM_STATE_FULLSCREENhint, sincesofficeitself no longer self-closes when a show ends (that was only ever true of
--show).2. Fidelity report
Three test decks, run through the real pipeline on this host (not the fake
tools the test suite uses — see below on why):
sample-deck.pptxfixture, 3 slides, notiming, no animation): renders correctly, holds on slide 1 forever (no
clicks to advance it — GRI-1967's already-known limitation).
fadetransition, 1.5s auto-advanceeach): correct. The real recording shows slide 1 → 2 → 3 advancing on
schedule with the fade playing, all three slides' text rendering
correctly.
entrance animation, plus the same auto-advancing fade transitions):
correct. The recording shows the title appear immediately and the
bullet text fade in about a second later, then the deck auto-advances
through slides 2 and 3 on the same schedule as the previous deck.
Per-effect: transition — correct. Entrance animation — correct, on the one
effect type tried (fade/
presetID=10). I did not get to testing more effecttypes (fly-in, zoom, exit effects, animation on multiple shapes/slides) or a
deck pulled from a real campus file rather than hand-built OOXML; flag if
that matters before Monday and I'll make time for it.
Click steps: not exercised — GRI-1967's already-flagged open question.
Nothing here sends a click, so a deck with any click-triggered step just
sits on that step until
render_timeout_secondsfires.Render time: wall-clock, real-time — a render takes as long as the
presentation actually plays, not faster. Every one of the decks above
hit the full
render_timeout_secondsregardless of how long the deck's owncontent takes — see the important finding below.
Peak memory: ~745 MiB RSS across
Xvfb+fluxbox+soffice+ffmpegtogether for one concurrent render job, steady-state (measured onthe animation deck, sampled once a second for its 15s run).
3. Important finding, not yet acted on: a slideshow does not end on its own
This is true independent of today's fix, and was previously masked by the
blank-render bug making it moot. Verified three separate ways (plain click-
driven deck; fully auto-timed deck with no loop setting; same with the
entrance animation): a LibreOffice Impress slideshow does not return to
the editor on its own, even once every slide has auto-advanced through to
the last one. It just holds there — the same "kiosk" behavior real
PowerPoint uses, which makes sense for signage, but it means
render_to_mp4's current contract (discard the recording entirely and fallback to slide images whenever the presenter reports
StillRunningAtTimeout,i.e. every deck, always) throws away a perfectly good recording every
time.
With this fix landed as-is, the practical behaviour for essentially every
real upload is: wait
render_timeout_seconds(120s default), then fall backto images anyway — the video path is reachable and correct when exercised
directly (see the fidelity report above), but nothing reaches it through a
normal upload. That is not a regression from this PR — the pre-existing
--showdesign had the identical "discard on timeout" contract — but it isnow the thing actually blocking a working video in practice, where before
it was the blank-render bug.
I did not change this contract in the same PR: redefining "timeout" as
success rather than failure is a product/acceptance-criteria call, not
a fix for a bug I found. Options as I see them, roughly in the order I'd
reach for them:
StillRunningAtTimeoutassuccess, trimmed to whatever was captured) rather than discarding it —
matches the kiosk-style, never-ends-on-its-own reality, and the signage
player can loop it the way it would loop any other video.
bounded per-slide dwell, then send Escape) instead of waiting for a
natural end that essentially never comes — more deterministic total
render time, more code.
images in practice until forge #33/GRI-1967 (click-driven decks) is
resolved more fully.
Flagging for a decision — happy to implement whichever once it's picked.
4. Also flagging, separately: the Docker image has none of these binaries
packaging/server/Dockerfileinstalls onlypoppler-utils(for the PDFfallback).
soffice,ffmpeg,Xvfb,fluxbox,gsand nowpptx_video_presenterare not installed there at all — this was alreadytrue before today (pre-dating this PR, from #190), so in an actual
deployed-from-this-Dockerfile instance, every
.pptxupload already failsrender_to_mp4withToolMissingand falls straight torender_fallback_pages, which also fails the same way (sofficemissingthere too) —
.pptxuploads are refused outright in Docker today. Notmine to fix in this PR (it's an infra/package-list decision, and a sizeable
one for a "slim" image), but worth knowing before Monday if the campus test
runs from that image rather than this host.
Test coverage
Unit tests (
crates/server/src/pptx_video.rsand the newpptx_video_presenter.rs's own#[cfg(test)]) cover the wiring — thepresenter's exit codes 0/2/other,
ToolMissing, the blank-renderdetector — with fake tools, same as before. They do not and cannot
exercise the real X11 behaviour this issue is about: the acceptance
test's own doc comment already states why (
crates/server/tests/ pptx_video_acceptance_integration.rs's doc comment) — the CI runner carriesneither
sofficenorXvfb. The fidelity report above is what stands infor that, run by hand on this host; I did not add a new
#[ignore]dreal-tool test for it, since nothing in CI would ever run it and that felt
like scope beyond what was asked. Say if you want one anyway for future
runs on a host that does have the binaries.
@aetherforge #192 is merged into
dev(required checks green on8ea3b8c2). Good root-cause work, and the report is exactly what was needed.Decision on section 3 (my call, the product owner delegated it): accept the recording, and trim it. Without this, no real upload ever reaches the video path, so the fix does not help the campus yet.
Your next item, one PR to
dev:StillRunningAtTimeoutwith a non-blank recording is success, not a fallback.freezedetect, which you already use), and cut the video a short hold after it starts (keep ~2 s of the last slide). A 3-slide auto-timed deck must give a ~6 s video, not 120 s. If the whole recording is frozen, it is still blank, and the fallback stays.idle_end_seconds(configuration, default 10), so a short deck does not cost 120 s of render time.render_timeout_secondsstays the hard limit.Tests: the trim and the idle end with fake tools, the same way as today. No
#[ignore]d real-tool test needed. Repeat your manual run on this host for the three decks, and post the video lengths here.Section 4 (Docker image): noted. That is a separate decision, I take it to the product owner. Not in your PR.
Implemented the three items from the 13:19 decision: (1) a timed-out presenter with a non-blank recording is now a success, not an error; (2) a trailing frozen tail is trimmed in place to the last real frame + 2s hold, via a second freezedetect pass and a stream-copy cut — a recording frozen from the first frame with no recovery is still read as blank and still falls back; (3) the wait now also ends early once the screen has held the same frame for
idle_end_seconds(default 10,SIGNAGE_PPTX_VIDEO_IDLE_END_SECONDS), raced against the presenter, so a short auto-timed deck does not cost the fullrender_timeout_seconds.Click-triggered steps stay out of this PR, as agreed — such a deck now gives a short video of its first step (via the trim path), not an error.
Manual run on this host, real tools, idle_end_seconds=6 for a fast check: plain deck and the timed-transition deck both idled out and trimmed to ~3.2s videos. The transition+animation deck was flaky independent of this change — intermittently failed to reach fullscreen, once with a panic inside x11rb-protocol's display-string parsing on a large random display number (reserve_display picks 100..65000). reserve_display/pptx_video_presenter are unchanged by this PR; flagging it here rather than folding it into this change. Worth a follow-up to pin reserve_display to a smaller range or investigate the x11rb overflow directly.
PR: #193 (dev <- fix/GRI-2014-pptx-trim-idle-end). Tests: unit (19/19 in pptx_video, 189/189 in the crate), acceptance integration (3/3, unchanged), full ./scripts/local-gates.sh --rust-only clean. Forge CI is running now.
PR #193 held for one change (review on the PR): idle-end at 10 s cuts auto-timed decks whose slides stay more than 10 s, silently. Fix: effective idle limit = max(idle_end_seconds, longest slide advTm + 3 s), read from the .pptx. Rest of #193 is OK.
PR #194 (8 MiB cap on the slide-xml read) merged into dev; CI green on
e54ac1b8. Last step before this closes: one end-to-end .pptx upload on current dev with an auto-timed deck whose slides advance after >10 s, plus one click-advance deck. Post the resulting MP4 length vs expected and what the click deck produced, then close this issue. Docker-image packaging (soffice/ffmpeg/Xvfb) waits on the product owner and is not part of this issue.End-to-end upload check on
dev(PRs #192/#193/#194 all merged): ran two real uploads with no fake tools — an auto-timed deck with slides over the 10sidle_end_secondsdefault, and a click-advance deck.Both decks fell back to slide images on the first pass (correctly: never a half item), reproducing the "pre-existing X/x11rb display-parsing issue" flagged earlier in this thread as a follow-up. Root-caused it:
reserve_display()picks a virtual display number from100..65000, andpptx_video_presenter's X11 client (x11rb-protocol) always computes alocalhostTCP fallback target as6000 + displayinu16arithmetic — a display ≥ 59536 overflows that addition and panics in a debug build, even thoughXvfbis only ever reached over its Unix socket here (started with-nolisten tcp). That is an ~8% chance per render on this build.Fixed in PR #195 (capped the range to
100..=59535, added a unit test asserting 200 draws stay in bounds). Re-ran the same two real uploads after the fix: both produced onevideoitem, no fallback.With that landed, the "Done when" bar from the top of this issue is met: a real upload with real tools renders one video; a render failure falls back to slide images and never a half item; converter paths/timeout/resolution are config (GRI-1884); acceptance tests run with no
#[ignore]. Closing this issue once PR #195 is merged.PR #195 (display range capped at 59535) merged into dev; required CI green on
4a45b0c1. Fix is correct and small.Before closing: my 14:22 ask is not answered yet. Please post the numbers from the two re-runs on dev:
Then close this issue.
Ran the end-to-end check you asked for (3x, real tools, current
devatcb1377c, no fake soffice/ffmpeg) — and the result is not the one I reported on #195. Flagging before anything else, since Monday's test depends on this.What I found: with a genuinely fresh per-job profile (what
render_to_mp4always uses —write_profilewrites one into a brand-newwork_dirfor every call, by design, for job isolation), the slideshow does not reliably go fullscreen on this host right now. 7 consecutive real end-to-end renders (3 different decks: thedeck.pptxclick-advance deck, a hand-built 3-slide auto-timed deck at 12s/slide, and the repo's ownsample-deck.pptxfixture) all produced the identical artifact: a ~3.2s MP4 of the LibreOffice editor window sitting idle (desktop background → editor paints → freezes there), trimmed by the idle-end/freeze-trim logic from #193 — never the real slideshow.render_to_mp4reports this asOk(())(a "successful" render), because the idle watch wins the internal race before the presenter's ownrender_timeout_secondshas a chance to report"the presentation never went fullscreen after F5"— confirmed by invokingpptx_video_presenterdirectly against the same display: that is exactly the error it raises on 2 manual reproductions, butrender_to_mp4currently swallows it in that race rather than surfacing it.So the practical effect today: a real
.pptxupload goes through the video path with no error, but the video is not the presentation — it's ~3 seconds of the loading screen. This is worse than the fallback case (which at least reaches real content via the slide images), and it directly contradicts the "Done when" bar at the top of this issue (and my #195 writeup, which I had not re-run against a truly fresh profile before posting — my mistake, sorry).I spent real time chasing the root cause (suspected a window-manager-focus race between
fluxboxadopting the new window andpptx_video_presentersending F5 —_NET_CLIENT_LISTmembership isn't the same as holding input focus) and tried explicitly setting input focus viaXSetInputFocusbefore F5. It did not reliably fix it: one manual run then reported "fullscreen" (presenter exit 2) while the actual screenshot still showed the plain editor window, which suggestsis_any_window_fullscreen's_NET_WM_STATE_FULLSCREENcheck can itself be a false positive on this window manager/host — a second, independent problem. I reverted that attempt rather than land a fix I can't verify; it's not in the diff.Given Monday: this needs focused attention, most likely from someone who can reproduce the X11/window-manager interaction directly (screen recording of the actual window-manager/F5 sequence, not just before/after snapshots) — I don't have a fix I trust in hand. Not closing this issue; the done-when bar is not met. Available for next steps now — say how you want this split (continue on it myself vs. handing the X11-specific part to someone else) and I'll proceed.
Thank you — this is the right call, and the honest re-run is worth more than the earlier report.
Decision, so Monday is safe. Two steps, both yours, in this order:
1. Now — one small PR, Monday-safe:
render_to_mp4: when the presenter reports never went fullscreen, that error must win over the idle watch, and the result isErr→ slide-image fallback. A render must never reportOkwithout proof that the slideshow ran.Slide images without animations are acceptable for the campus test (PO decision: how the server shows a .pptx is our choice). A 3-second video of the editor is not.
2. After that PR is merged — root cause, no deadline of Monday:
is_any_window_fullscreen.Ping me on this issue when the step-1 PR is open.
Implemented step 1 of the 15:3x decision (config gate + race fix). Working tree:
/home/aetherforge/repos/wt-GRI-2014, branchfix/GRI-2014-pptx-mp4-flag-fallback, off currentdev(cb1377c).1. Config gate, default off.
PptxVideoConfig.mp4_enabled: bool(defaultfalse, envSIGNAGE_PPTX_VIDEO_MP4_ENABLED, GRI-1884-compliant).convert_pptxinmedia/handlers.rsnow only callsrender_to_mp4when it'strue; otherwise every.pptxupload goes straight to the slide-image fallback, unconditionally. New acceptance testmp4_is_off_by_default_the_upload_still_falls_back_to_pagesproves this end to end, with fakes that would otherwise make the MP4 render succeed.2. The race itself, fixed, not just gated. Root cause:
render_to_mp4'stokio::select!racesrun_presenter(which only reports "never went fullscreen" after the fullrender_timeout_seconds) againstwatch_for_idle_screen(which reports idle after the much shorteridle_end_seconds). A deck stuck on its loading screen is just as "idle" as one that finished normally, so idle always won first and the presenter's eventualErrwas silently dropped — never awaited at all.Fix:
pptx_video_presenternow prints one line,FULLSCREEN, to stdout the instant it first observes the slideshow fullscreen.run_presenterreads the presenter's stdout as it runs (not viaCommand::output, which only returns at exit) and sets a sharedFullscreenSignalon that line.watch_for_idle_screennow waits on that signal before it starts polling for stillness at all — so a presenter that never reaches fullscreen never lets the idle branch complete, and theselect!can only resolve throughrun_presenter's own branch, which eventually does returnErr.New regression test
a_presenter_that_never_reaches_fullscreen_is_not_overridden_by_an_idle_screen: fake presenter that sleeps 2s then exits 1 with "never went fullscreen", against a 1s idle screen that would have won under the old code — now correctly resolves toErr(Failed("the presenter"))instead of a false success. 25/25pptx_videounit tests green (including the existing idle-screen test, updated to emit the marker, now correctly modeling "already fullscreen, stuck waiting for a click" rather than "never fullscreen at all" — those are different cases and the existing test was conflating them, which is exactly what let the bug through).cargo fmt/clippy -D warningsclean../scripts/local-gates.sh --rust-onlyrunning now in the background; will report before pushing.Not closing #189 — step 2 (root cause of the real-host blank render + content-based check, not just freeze-based) is still open and unstarted.
Step-2 root-cause session, real tools, no fake soffice/ffmpeg: isolated the race down to a specific window, and tried three fixes — none beat the baseline, one made it clearly worse. Reporting honestly rather than shipping a guess.
Root cause, confirmed with a live X11 property-watcher (not in the diff — scratch tooling, discarded):
soffice's "Tip of the Day" first-run dialog maps as a second top-level window, on top of the document window, roughly half the time — despitewrite_profile'sShowTipOfTheDay=falsefuse. It steals the input focus (_NET_ACTIVE_WINDOWpoints at it, confirmed live), so the synthetic F5 — sent once, to the root window, at a fixed point — lands on the dialog instead of the document and does nothing. The config fuse is real but not reliable enough to trust on its own; a disabled-by-config dialog that still sometimes shows is not a setting worth chasing further.What I tried, each verified over 6-8 real
Xvfb/fluxbox/sofficeruns (fresh profile, fresh private copy of the fixture each time — baseline is ~50% fullscreen, confirmed again before touching anything):sofficeputs up, dismiss it with a synthetic Escape, then explicitlySetInputFocusonto the document window and (re)send F5 on every poll tick until fullscreen or timeout. Result: 0/6. Worse than baseline.SetInputFocuscall (suspecting the rawSetInputFocuswas fighting fluxbox's own focus tracking). Result: 0/8.All three regress below the ~50% baseline (plain single F5, no dialog handling) I re-confirmed going in. I reverted all of it — nothing from this session is in the branch;
wt-GRI-2014is back atorigin/devwith a clean tree, and I removed the worktree.Why I'm stopping here rather than iterating further: the one case I captured live showed the dialog appearing and disappearing inside a single ~300ms window — close to my 200ms poll interval — so dismiss-then-resend keystrokes are landing in an order I can't actually see or control from outside the process, and I have no
xprop/xdotool/wmctrlon this host to inspect focus and window state without writing throwaway tooling each time (which I did — anx11rb-based watcher — but it only observes, it can't explain why a clean, focused, undialogued document window still won't react to F5 for the rest of the run, which happened in every one of my 2nd/3rd-attempt failures).This has no bearing on Monday, since
mp4_enableddefaults off (PR #196, merged) and every.pptxupload is slide-image-only until this is solved. Given there's no deadline on step 2 (per the 15:30 decision) and my last three attempts all regressed, I'd rather stop and report than keep guessing at the live system's expense. Two concrete asks if this is to continue:xdotool/x11-utils(xprop,xwininfo) on this build host would cut the iteration loop a lot — right now every observation needs a disposable Rust binary.Play the slides instead of a video? Yes, but not with our own PowerPoint engine
Short answer: writing our own PowerPoint player in Rust is not realistic. But there is a middle option that gives what you asked for: play the slides on the screen, with no video recording. LibreOffice can export a
.pptxto one SVG file that carries its own slideshow engine (JavaScript, with transitions and animations). The player already has a WebKit view (wry, used for URL items), so it can play that file directly.The three options
soffice --headless --convert-to svg:impress_svg_Exportat upload. The client plays the SVG in the existingwryviewWhat I measured on the build host (LibreOffice 24.2.7)
deck_a.pptxwith a fade transition and one animation, and a 3-slide deck with 12 s auto-timings) each converted in ~1 s, ~215 MB peak RAM, headless, with no display.ooo:has-transition="true"for the slides with a transition, the animation tree (anim:par,anim:seq,anim:transition, SMIL timings such assmil:dur="0.5s") and LibreOffice's "presentation engine" script.deck_a(a motion/position effect) came out assmil:attributeName="invalid". So the SVG engine does not support every effect. The MP4 route records the same LibreOffice engine, so it would also lose some, but not always the same ones.Not checked yet: playback in our WebKitGTK view, auto-advance driven from Rust, and smoothness on a Raspberry Pi. Those three decide if C works.
Recommendation
C, as a spike before we spend more time on the MP4 race. It removes the cause of the failure (an X session that must keep focus) instead of working around it, and it uses only parts we already ship (LibreOffice on the server, WebKit on the client). The slide images from #33 stay as the fallback, as they are now.
Concrete next step (aetherforge, ~1 day): play the two exported test decks in
renderer_spike, advance them from Rust, and measure CPU and frame drops on a Pi. If the Pi cannot keep up, A stays the option for the Pi and C becomes the option for stronger players. You can set this per device group, like the transcoding profiles.Monday's campus test is not affected:
mp4_enableddefaults off (PR #196), so.pptxuploads give slide images.Your decision: spike C, or keep working on the MP4 race (A)?
Do all animations work in the SVG slideshow? No — measured 2026-11-14
Read out of the slideshow engine that LibreOffice 24.2.7 puts in the exported SVG (
createAnimationNodein the embedded script):animate,set,transitionfilterare implementedanimatetransform(scale, rotate, translate),animatecolor, opacityiterateis implementedlog('ANIMATEMOTION not implemented'); return null— the effect is dropped. This is the effect lost indeck_aAUDIO not implemented(no sound on a screen anyway)COMMAND not implementedThe MP4 route (A) records Impress itself, which plays motion paths, so A is more faithful for those. A does not play Morph either, and 3D transitions need OpenGL that a headless Xvfb usually does not have.
What this means: the effects most school decks use — appear, fade, fly in, wipe, zoom, spin — work. Motion paths are the main gap.
Proposal: at upload, the server reads the exported SVG for effects the engine cannot play (
anim:animateMotion,anim:audio,anim:command) and shows the uploader a warning: "This deck uses motion paths; they will not move on the screen." If MP4 rendering works some day, the server can choose MP4 for those decks only.Option D (product owner, 2026-11-14): read the transitions, build the video ourselves
Idea: do not record LibreOffice. Read each slide's transition out of the
.pptxXML, render each slide to an image (the server already does this for the image fallback:soffice→ PDF →pdftoppm), and letffmpegjoin the images with the matching transition.Measured on the build host, deck
deck_a.pptx(2 slides, 0.5 s fade):ppt/slides/slideN.xml:<p:transition spd="fast" advTm="500" p14:dur="500"><p:fade/>. Type, duration and auto-advance time are all there. No LibreOffice needed to read it.pdftoppm.ffmpeg -loop 1 -i s-1.png -loop 1 -i s-2.png -filter_complex "[0][1]xfade=transition=fade:duration=0.5:offset=4.5"→ 9.5 s H.264, 39 KB, 2.1 s wall time, no X server. A frame at 4.75 s shows both slides half-blended: the fade is right.Transition mapping. ffmpeg 6's
xfadehas 56 transitions. Most common PowerPoint ones map directly:<p:…>)xfadefade,fade thruBlk="1"fade,fadeblackpush dir=…slideleft/right/up/downcover dir=…/pull dir=…coverleft…/revealleft…wipe dir=…wipeleft…split,circle,dissolve,zoomvertopen/horzopen,circleopen,dissolve,zoominrandomBar,blinds,checker,stripshlslice,diagtl, …)p14:vortex,cube,flip…), MorphfadeWhat D cannot do: animations inside a slide (a bullet that flies in, a picture that spins, motion paths). The slide image is the final state, so those elements are simply there from the start. That is the big gap compared with C. It can be closed partly later (render build steps as separate images), but that is real work.
What D does well: fully deterministic, no display, no focus race, the same tools the server already runs, and the output is the MP4 the player already plays with hardware decode — so no load question on a Pi.
C vs D
xfade; 3D → fade)pdftoppm+ffmpeg, ~4 s for 2 slidesRecommendation: build D first. It replaces the flaky Xvfb recording with no new player code and no unknowns, and it fixes #189. Decks that use in-slide animations get an upload note: "Animations inside slides are not played; slide transitions are." C stays an option for later if those animations turn out to matter.
Decision (product owner, 2026-11-14 17:14, GRI-2043): build option D. It replaces the Xvfb recording.
@aetherforge this is the new approach for #189. The xdotool / Tip-of-the-Day question on GRI-2014 is no longer needed: no X server, no recording.
His words: "Build the idea that I gave, but try to support as many between pages animations. So object animations you can skip for now. Just focus on the transition animations and also read how long the pptx was waiting on that page. If no time was set, pick the campus default." The test campus uses slide transitions only, no object animations.
Pipeline (server, at upload)
ppt/presentation.xml(p:sldIdLst, skipshow="0"hidden slides), then perppt/slides/slideN.xmlthe<p:transition>element:p:fade,p:push dir=,p:wipe dir=,p:cover,p:pull,p:split,p:circle,p:dissolve,p:zoom,p:randomBar,p:blinds,p:checker, … and thep14:*ones insidemc:AlternateContent).p14:dur(ms); elsespd(fast/med/slow, ~0.5/0.75/1.0 s).advTm(ms). NoadvTm(advance on click) → the campus defaultdefault_duration_secondsfromplayback_settingsfor the uploader's campus, falling back to the global row.soffice --convert-to pdf→pdftoppm), at the configured resolution.ffmpegxfade: one input per slide (-loop 1 -t <dwell+transition>), a chain ofxfade=transition=<map>:duration=<d>:offset=<o>, H.264 out. Measured on this host: 2 slides, 9.5 s video in 2.1 s.Transition map
Support as many as
xfadecan: fade, push (slideleft/right/up/down), cover (cover*), pull/reveal (reveal*), wipe (wipe*), split (horzopen/close,vertopen/close), circle (circleopen/close), dissolve, zoom (zoomin), plus near matches for blinds, checker, random bars, wedge, clock (radial). Unknown, 3D and Morph →fade. No<p:transition>→ hard cut. Keep the map in one table with a test per row.Scope
<p:timing>with animations: "Animations inside slides are not played; slide transitions are."mp4_enabledcan become the switch for this path (default on once the acceptance test passes, your call, say which).Done when
advTmand one without: one video item; the slide times areadvTmand the campus default; a frame mid-transition shows both slides.#[ignore].Implemented GRI-2043's option D — PR #199.
Approach: no display server, no recording.
read_slide_timingsreads each visible slide's<p:transition>(type +p14:dur/spd) andadvTmstraight out of the.pptxzip/XML (ppt/presentation.xml's<p:sldIdLst>for order, its.relsfor the id→part mapping, each slide's ownshow="0"to skip hidden ones — the same slidessoffice --convert-to pdfalready leaves out, so the two line up index-for-index).map_transitionmaps the PowerPoint type to the closest offfmpeg xfade's 56 effects (fade/push/cover/pull/wipe/split/circle/dissolve/zoom direct, a few near matches for blinds/checker/randomBar/wedge/clock, everything else — unknown, 3D, Morph — falls back to fade, per the spec).Timelinedoes the chained-offset arithmeticffmpeg's-filter_complexneeds for N inputs. A slide with noadvTmuses the uploading campus's configured default page duration (playback_settings::effective_default_duration_seconds).mp4_enablednow defaults on (my call, as the decision on this issue left to me, conditioned on "once the acceptance test passes" — it has, see below): there's nothing left here that needs anXvfb/focus-race safety valve to default off for.Done-when checklist:
advTmand one without, mid-transition frame shows both slides — verified manually with realsoffice/gs/ffmpegon this host: built a 3-slide deck (fade transition +advTm=500mson slide 2, pushdir=ltransition with noadvTmon slide 3), ran the real pipeline, and pulled frames at the computed mid-transition timestamps. The fade frame shows both slides' text overlaid (translucent "1"/"2" digits blending); the push frame shows slide 2 sliding out to the left and slide 3 sliding in from the right. Both exactly as expected.map_transition_matches_every_row_of_the_table(one assertion per table row, per the spec), plusread_slide_timings_*(reads transition+advTm, skips a hidden slide, treats no<p:transition>as a hard cut, rejects a non-zip or an oversized slide part — the same zip-bomb guard the oldlongest_slide_advance_secondshad).#[ignore]: 4 tests inpptx_video_acceptance_integration.rs, all against fakesoffice/gs/ffmpeg(CI has none of the three real binaries) — successful join → one video item;mp4_enabledoff → fallback never attempts the join; a join failure (missingffmpeg) → falls back to the already-rendered slide images, never a half item; both paths missing → clean refusal, no catalog entry.Out of scope, as decided: object animations inside a slide (bullet flies in, picture spins, motion paths) — the slide image is the deck's final rendered state, so those are simply present from the start. The upload-note nice-to-have for decks with
<p:timing>is not implemented in this PR; flagging as a possible follow-up if it turns out to matter, since it needs new API/frontend surface and wasn't in the "done when" list.Verified locally:
cargo test -p server --lib pptx_video(23/23),cargo test -p server --test pptx_video_acceptance_integration(4/4, real Postgres + fake tools),./scripts/local-gates.sh --rust-onlyall green (only the pre-existing, branch-unrelatedcargo denyadvisories failure — RUSTSEC-2024-0429 via the client crate's glib/webkit stack — remains, unchanged by this branch).Deleted
src/bin/pptx_video_presenter.rsand thex11rbdependency — nothing here opens an X display any more.CI running on PR #199; will report the verdict and close this issue once it merges.
Final piece (#199) merged into
devat6b0d3fc1.fj landed GRI-2014confirms the whole chain is in dev's history (19 commits across #190, #192, #193, #194, #195, #196, #199).Final approach (per the product owner's decision on GRI-2043, superseding the recorded-slideshow approach this issue started with): build the MP4 by compositing the already-rendered slide images with ffmpeg
xfade, using transition type/duration and advance timing read straight out of the .pptx's own XML (ppt/slides/*.xml). No Xvfb, no window manager, no X11 — which also closes out the flaky focus/fullscreen race documented earlier in this thread (soffice's Tip-of-the-Day dialog stealing focus from the synthetic F5); that whole code path is no longer on the critical path for MP4 output.Done-when, checked against the final state in dev:
#[ignore]) and manually with real soffice/gs/ffmpeg — a fade+advTm slide and a push slide both produced correct mid-transition blend frames.PptxVideoConfig, GRI-1884).#[ignore](cargo test -p server --test pptx_video_acceptance_integration).mp4_enableddefaults on for this final design (no display-server race to gate against any more).Closing.