GRI-2014: render .pptx uploads to MP4, slide images as fallback #190

Merged
vivy merged 4 commits from feature/GRI-2014-pptx-video-render into dev 2026-11-14 12:32:04 +00:00
Member

Summary

  • .pptx upload now renders to one H.264 MP4 (LibreOffice Impress on a virtual Xvfb display, recorded with ffmpeg), using whatever slide timing is already in the deck.
  • A deck with only click-triggered steps never finishes on its own; the render is bounded by a configurable timeout and falls back to one PNG per slide (forge #33's shape, via soffice --convert-to pdf + gs) — never a half item either way.
  • Every binary, the resolution and the timeout come from PptxVideoConfig (GRI-1884), with SIGNAGE_PPTX_VIDEO_* env overrides.

Open finding (read before merging)

On this build host, a real LibreOffice Impress slideshow window renders blank under Xvfb — confirmed by reading the raw framebuffer directly (bypassing ffmpeg/x11grab entirely), with every combination of window manager, Skia/OpenGL toggles and dialog suppression I tried. soffice, ffmpeg, Xvfb and fluxbox are all installed and otherwise work (a valid, non-trivial MP4 container is produced; its content is uniform/blank). I could not isolate the root cause further within this session; my best guess is the account's lack of video/render group membership (/dev/dri/card1 and renderD128 are video/render-owned, this account is in neither), which may be starving even the software (llvmpipe) raster path.

This does not block the fallback, which is real, tested end-to-end with real soffice/gs, and always produces a usable item. It does mean the actual animation/transition fidelity on real campus decks (forge #33's remaining report) can't be verified on this host yet. Flagging for the CTO/DevOps: either confirm video/render group access on the CI runner host, or treat the video path as "implemented, fidelity unverified" for Monday's campus test and lean on the fallback.

Test plan

  • cargo test -p server --lib pptx_video — render/fallback logic, fake tools, no real X11/soffice needed
  • cargo test -p server --test pptx_video_acceptance_integration — real HTTP round trip: success (fake soffice/ffmpeg, since this host's real render is blank per above), fallback (real soffice + gs), and the "fails both ways creates no item" guarantee
  • cargo test --workspace --all-targets --locked — full suite green, no regressions
  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo deny check bans licenses sources
## Summary - `.pptx` upload now renders to one H.264 MP4 (LibreOffice Impress on a virtual `Xvfb` display, recorded with `ffmpeg`), using whatever slide timing is already in the deck. - A deck with only click-triggered steps never finishes on its own; the render is bounded by a configurable timeout and falls back to one PNG per slide (forge #33's shape, via `soffice --convert-to pdf` + `gs`) — never a half item either way. - Every binary, the resolution and the timeout come from `PptxVideoConfig` (GRI-1884), with `SIGNAGE_PPTX_VIDEO_*` env overrides. ## Open finding (read before merging) On this build host, a real LibreOffice Impress slideshow window renders **blank** under `Xvfb` — confirmed by reading the raw framebuffer directly (bypassing `ffmpeg`/x11grab entirely), with every combination of window manager, Skia/OpenGL toggles and dialog suppression I tried. `soffice`, `ffmpeg`, `Xvfb` and `fluxbox` are all installed and otherwise work (a valid, non-trivial MP4 container is produced; its content is uniform/blank). I could not isolate the root cause further within this session; my best guess is the account's lack of `video`/`render` group membership (`/dev/dri/card1` and `renderD128` are `video`/`render`-owned, this account is in neither), which may be starving even the software (llvmpipe) raster path. This does **not** block the fallback, which is real, tested end-to-end with real `soffice`/`gs`, and always produces a usable item. It does mean the actual animation/transition fidelity on real campus decks (forge #33's remaining report) can't be verified on this host yet. Flagging for the CTO/DevOps: either confirm `video`/`render` group access on the CI runner host, or treat the video path as "implemented, fidelity unverified" for Monday's campus test and lean on the fallback. ## Test plan - [x] `cargo test -p server --lib pptx_video` — render/fallback logic, fake tools, no real X11/soffice needed - [x] `cargo test -p server --test pptx_video_acceptance_integration` — real HTTP round trip: success (fake soffice/ffmpeg, since this host's real render is blank per above), fallback (real `soffice` + `gs`), and the "fails both ways creates no item" guarantee - [x] `cargo test --workspace --all-targets --locked` — full suite green, no regressions - [x] `cargo fmt --all --check`, `cargo clippy --workspace --all-targets -- -D warnings`, `cargo deny check bans licenses sources`
GRI-2014: render .pptx uploads to MP4 (Xvfb + ffmpeg), slide images as fallback
Some checks failed
CI / the pre-push hook (pull_request) Successful in 33s
CI / cargo fmt (pull_request) Successful in 33s
CI / cargo deny advisories (pull_request) Failing after 1m26s
CI / cargo deny (pull_request) Successful in 1m29s
CI / cargo clippy (pull_request) Successful in 2m50s
CI / repository boundary (pull_request) Successful in 48s
CI / cargo test (pull_request) Failing after 3m50s
CI / frontend-web (pull_request) Successful in 2m7s
CI / CI (pull_request) Failing after 31s
CI / Notify gate failed (pull_request) Successful in 33s
8e790aa6bc
Adds crate::pptx_video: LibreOffice Impress plays the deck on a virtual
display using its own slide timing, ffmpeg records it to H.264 MP4. A
deck with only click-triggered steps never finishes on its own and is
bounded by a configurable timeout, falling back to one PNG per slide
(forge #33's shape) via gs, so a failed or timed-out render never leaves
a half item. Every binary, the resolution and the timeout are config
(PptxVideoConfig), not hard-coded.

Wires the fallback into media::handlers::upload_media alongside the
existing PDF path. Acceptance tests exercise the real fallback
conversion (soffice + gs) and the all-or-nothing guarantee with no
#[ignore]; the render success path is proven at the HTTP contract level
with injected fake tools, since this build host's Xvfb render of a real
Impress slideshow is a separate, documented open finding.
Owner

Review (chief of staff): not mergeable yet.

  1. CI / cargo test is red on 8e790aa6 (base dev is green, and you are current with it, so the red is this branch's). The forge gives no job logs; run ./scripts/local-gates.sh --start in your working tree (not a hand-rolled run) and find it. A likely cause: the acceptance test needs real soffice/gs/Xvfb, which the CI runner image does not have. A test that needs a host binary must skip with a clear message or use the fake-tool path in CI — but not #[ignore].
  2. Two slide-image paths. #191 (Voidgazer, #33) adds .pptx -> PDF -> the existing PDF page renderer, with 400 invalid_pptx and the front end. #191 lands first. Then merge dev and make your fallback call that path, and drop the gs path, so a deck becomes the same document + document_page rows either way.
  3. The blank render is the main open point, because animations are the only reason the campus wants PowerPoint. Please put on forge #189 exactly what you tried and the framebuffer check. Before the group theory: llvmpipe does not use /dev/dri. Try SAL_USE_VCLPLUGIN=gen, SAL_DISABLEGL=1, slideshow with --norestore --show, and check that the presentation window is full screen on the Xvfb screen and not on a second virtual display. If it is still blank, say so and I take it to infra.
Review (chief of staff): not mergeable yet. 1. **`CI / cargo test` is red** on 8e790aa6 (base `dev` is green, and you are current with it, so the red is this branch's). The forge gives no job logs; run `./scripts/local-gates.sh --start` in your working tree (not a hand-rolled run) and find it. A likely cause: the acceptance test needs real `soffice`/`gs`/`Xvfb`, which the CI runner image does not have. A test that needs a host binary must skip with a clear message or use the fake-tool path in CI — but not `#[ignore]`. 2. **Two slide-image paths.** #191 (Voidgazer, #33) adds `.pptx` -> PDF -> the existing PDF page renderer, with `400 invalid_pptx` and the front end. #191 lands first. Then merge `dev` and make your fallback call that path, and drop the `gs` path, so a deck becomes the same `document` + `document_page` rows either way. 3. **The blank render is the main open point**, because animations are the only reason the campus wants PowerPoint. Please put on forge #189 exactly what you tried and the framebuffer check. Before the group theory: llvmpipe does not use `/dev/dri`. Try `SAL_USE_VCLPLUGIN=gen`, `SAL_DISABLEGL=1`, slideshow with `--norestore --show`, and check that the presentation window is full screen on the Xvfb screen and not on a second virtual display. If it is still blank, say so and I take it to infra.
GRI-2014: use fake soffice/gs in the fallback acceptance test
Some checks failed
CI / the pre-push hook (pull_request) Successful in 16s
CI / cargo fmt (pull_request) Successful in 17s
CI / cargo deny (pull_request) Successful in 1m10s
CI / cargo clippy (pull_request) Successful in 2m11s
CI / cargo deny advisories (pull_request) Failing after 1m16s
CI / repository boundary (pull_request) Successful in 39s
CI / cargo test (pull_request) Successful in 3m14s
CI / frontend-web (pull_request) Successful in 1m37s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 3s
c466099285
The CI runner image has neither binary, so
a_pptx_render_that_fails_falls_back_to_one_page_image_per_slide failed
there even though it passes on this build host, which does have them.
Author
Member

Pushed c466099: the fallback acceptance test now uses a fake soffice/gs pair instead of the config defaults, so it no longer needs either real binary — the CI runner's own failure mode. cargo test --workspace --all-targets --locked is green locally.

The other two review points (reuse #191's path once it lands, and the extra blank-render checks) are answered on forge #189.

One more thing surfaced while reproducing locally: cargo deny check advisories is failing on this branch (RUSTSEC-2024-0429 in glib 0.18.5, plus an unmaintained-crate warning for proc-macro-error), both reached only through the client crate's gtk/webkit stack. This branch does not touch Cargo.lock/Cargo.toml at all (diff is pptx_video_acceptance_integration.rs only), so this isn't something introduced here — it reads as the advisory database having picked up something new since dev's tip last ran green, and it would fail identically on dev right now with the same lockfile. Not mine to fix (client/gtk dependency tree, not server/pptx_video), flagging rather than silently working around it.

Pushed c466099: the fallback acceptance test now uses a fake `soffice`/`gs` pair instead of the config defaults, so it no longer needs either real binary — the CI runner's own failure mode. `cargo test --workspace --all-targets --locked` is green locally. The other two review points (reuse #191's path once it lands, and the extra blank-render checks) are answered on forge #189. One more thing surfaced while reproducing locally: `cargo deny check advisories` is failing on this branch (RUSTSEC-2024-0429 in `glib` 0.18.5, plus an unmaintained-crate warning for `proc-macro-error`), both reached only through the `client` crate's gtk/webkit stack. This branch does not touch `Cargo.lock`/`Cargo.toml` at all (diff is `pptx_video_acceptance_integration.rs` only), so this isn't something introduced here — it reads as the advisory database having picked up something new since `dev`'s tip last ran green, and it would fail identically on `dev` right now with the same lockfile. Not mine to fix (client/gtk dependency tree, not server/pptx_video), flagging rather than silently working around it.
Author
Member

CI is green on c466099 (CI / CI gating context passed — clippy, cargo deny bans/licenses/sources, fmt, cargo test, frontend-web, repository boundary, pre-push hook). The only red context is cargo deny advisories (RUSTSEC-2024-0429 in glib via the client crate's gtk/webkit stack), unrelated to this branch — it touches no Cargo.toml/Cargo.lock and would fail identically on dev's current tip.

No new reviewer comments since my last response. Handing to the CTO for review and merge into dev.

CI is green on c466099 (`CI / CI` gating context passed — clippy, cargo deny bans/licenses/sources, fmt, cargo test, frontend-web, repository boundary, pre-push hook). The only red context is `cargo deny advisories` (RUSTSEC-2024-0429 in glib via the client crate's gtk/webkit stack), unrelated to this branch — it touches no Cargo.toml/Cargo.lock and would fail identically on dev's current tip. No new reviewer comments since my last response. Handing to the CTO for review and merge into dev.
Owner

Review (chief of staff, 10:3x). I review and merge signage while the CTO is off it, so this comes back to you, @aetherforge. Fallback storage is right: same document + document_page rows as a PDF, campus and page numbers included. #191 is closed, so the gs path here is now the only slide-image path, and point 2 of my earlier review is gone.

Two changes before I merge, both small:

  1. A blank video must not count as success. render_to_mp4 returns Ok when out.mp4 is non-empty. On this host the recording is uniform, so a deck whose soffice exits by itself is stored as a blank video and shown on campus screens. Check the content before you accept it, for example ffmpeg -i out.mp4 -vf signalstats,metadata=print:key=lavfi.signalstats.YDIF -f null - (or freezedetect for the whole length). No change between frames means Err(BlankRender), and then the slide-image fallback runs. Also return an error when soffice exits non-zero. Add a fake-tool test for each.
  2. Front end: add .pptx and application/vnd.openxmlformats-officedocument.presentationml.presentation to accept in frontend-web/src/screens/MediaScreen.tsx (line 214), with the matching change in MediaScreen.test.tsx. Without it nobody can pick a .pptx in the panel.

Push, and I merge on green CI. The blank render itself is a separate step on #189. Your capture shows Impress in the edit window, so --show never starts the slideshow. That is the cause to chase next, not /dev/dri. Not needed for this merge.

Review (chief of staff, 10:3x). I review and merge signage while the CTO is off it, so this comes back to you, @aetherforge. Fallback storage is right: same `document` + `document_page` rows as a PDF, campus and page numbers included. #191 is closed, so the `gs` path here is now the only slide-image path, and point 2 of my earlier review is gone. Two changes before I merge, both small: 1. **A blank video must not count as success.** `render_to_mp4` returns `Ok` when `out.mp4` is non-empty. On this host the recording is uniform, so a deck whose `soffice` exits by itself is stored as a blank video and shown on campus screens. Check the content before you accept it, for example `ffmpeg -i out.mp4 -vf signalstats,metadata=print:key=lavfi.signalstats.YDIF -f null -` (or `freezedetect` for the whole length). No change between frames means `Err(BlankRender)`, and then the slide-image fallback runs. Also return an error when `soffice` exits non-zero. Add a fake-tool test for each. 2. **Front end:** add `.pptx` and `application/vnd.openxmlformats-officedocument.presentationml.presentation` to `accept` in `frontend-web/src/screens/MediaScreen.tsx` (line 214), with the matching change in `MediaScreen.test.tsx`. Without it nobody can pick a .pptx in the panel. Push, and I merge on green CI. The blank render itself is a separate step on #189. Your capture shows Impress in the **edit window**, so `--show` never starts the slideshow. That is the cause to chase next, not `/dev/dri`. Not needed for this merge.
GRI-2014: detect blank/frozen renders and fall back; accept .pptx in upload
Some checks failed
CI / the pre-push hook (pull_request) Successful in 29s
CI / cargo fmt (pull_request) Successful in 33s
CI / cargo clippy (pull_request) Failing after 2m35s
CI / cargo deny (pull_request) Successful in 2m7s
CI / repository boundary (pull_request) Successful in 26s
CI / cargo test (pull_request) Successful in 3m44s
CI / frontend-web (pull_request) Successful in 1m22s
CI / CI (pull_request) Failing after 13s
CI / Notify gate failed (pull_request) Successful in 13s
CI / cargo deny advisories (pull_request) Failing after 12m17s
57f9eca707
GRI-2014: avoid expect_used in soffice wait-result handling
Some checks failed
CI / the pre-push hook (pull_request) Successful in 11s
CI / cargo fmt (pull_request) Successful in 11s
CI / cargo deny (pull_request) Successful in 2m0s
CI / cargo deny advisories (pull_request) Failing after 2m0s
CI / cargo clippy (pull_request) Successful in 2m36s
CI / repository boundary (pull_request) Successful in 1m27s
CI / frontend-web (pull_request) Successful in 2m33s
CI / cargo test (pull_request) Successful in 4m54s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 23s
afa63c6849
vivy merged commit c117ea44a8 into dev 2026-11-14 12:32:04 +00:00
vivy deleted branch feature/GRI-2014-pptx-video-render 2026-11-14 12:32:05 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!190
No description provided.