GRI-2014: build .pptx video from slide images and ffmpeg xfade #199

Merged
vivy merged 1 commit from feature/GRI-2014-pptx-xfade-video into dev 2026-11-14 18:10:53 +00:00
Member

What

Replaces the Xvfb-recorded slideshow render (PRs #190–#196) with GRI-2043's
"option D": read each slide's transition and advTm out of the .pptx XML,
render the same slide images the fallback already produces, and join them
with ffmpeg xfade using the closest matching effect. No display server, no
recording, no focus race — deterministic, and fully covered by tests that run
without soffice/ffmpeg/gs installed (CI has none of the three).

Changes

  • crates/server/src/pptx_video.rs: rewritten. render_fallback_pages is
    unchanged (now also the first step of the video path, not just the
    fallback); the Xvfb/presenter machinery is replaced with
    join_slides_into_mp4, read_slide_timings (zip + regex XML reader for
    ppt/presentation.xml + its .rels + each slide part, skipping hidden
    slides), map_transition (the PowerPoint → xfade table), and Timeline
    (the chained-offset arithmetic for ffmpeg's -filter_complex).
  • Deleted src/bin/pptx_video_presenter.rs and the x11rb dependency —
    nothing here opens an X display any more.
  • crate::config::PptxVideoConfig: dropped xvfb_path, window_manager_path,
    presenter_path, idle_end_seconds. mp4_enabled now defaults on
    (my call, as the decision asked — the render has nothing left to default
    off for: no Xvfb, no recording, covered by the acceptance tests below).
  • crate::playback_settings::effective_default_duration_seconds: new public
    helper so media::handlers::convert_pptx can look up the uploading
    campus's configured page duration as the dwell time for a slide with no
    advTm of its own.
  • crate::media::handlers::convert_pptx: always renders slide images first,
    then tries the join on top of them — a join failure keeps the
    already-rendered images rather than re-running anything.
  • plan/server/media-pipeline.md, plan/server/content-model.md: updated
    for the new approach.

Done when (forge #189 / GRI-2043)

  • A .pptx with a fade and a push, one slide with advTm and one
    without: one video item; the slide times are advTm and the campus
    default; a frame mid-transition shows both slides — verified manually
    with real soffice/gs/ffmpeg on this host (fade and push frames
    both show the expected blend/slide; details in the forge comment).
  • Unit tests for the XML reader and the transition map (one test per
    table row); acceptance test without #[ignore].
  • Due for the campus test, Monday 16 Nov.

Test plan

  • cargo test -p server --lib pptx_video — 23/23 unit tests (XML reader,
    transition map table, timeline/offset arithmetic, filter-complex
    construction, the join and fallback paths against fake tools).
  • cargo test -p server --test pptx_video_acceptance_integration — 4/4,
    against a real Postgres, with fake soffice/gs/ffmpeg.
  • ./scripts/local-gates.sh --rust-only — every gate green (fmt, clippy,
    cargo deny bans/licenses/sources, the full workspace test suite including
    the acceptance tests above, repo-boundary, pre-push hook). Pre-existing,
    branch-unrelated cargo deny advisories failure (RUSTSEC-2024-0429, glib
    via the client crate) unchanged.
  • Manual, real-tool verification on this host: built a deck with a fade
    transition + advTm=500ms on slide 2 and a push transition with no
    advTm on slide 3, ran it through the real soffice/gs/ffmpeg
    pipeline, and inspected frames mid-transition — both show the expected
    blend between slides.
## What Replaces the Xvfb-recorded slideshow render (PRs #190–#196) with GRI-2043's "option D": read each slide's transition and `advTm` out of the `.pptx` XML, render the same slide images the fallback already produces, and join them with `ffmpeg xfade` using the closest matching effect. No display server, no recording, no focus race — deterministic, and fully covered by tests that run without `soffice`/`ffmpeg`/`gs` installed (CI has none of the three). ## Changes - `crates/server/src/pptx_video.rs`: rewritten. `render_fallback_pages` is unchanged (now also the first step of the video path, not just the fallback); the Xvfb/presenter machinery is replaced with `join_slides_into_mp4`, `read_slide_timings` (zip + regex XML reader for `ppt/presentation.xml` + its `.rels` + each slide part, skipping hidden slides), `map_transition` (the PowerPoint → `xfade` table), and `Timeline` (the chained-offset arithmetic for `ffmpeg`'s `-filter_complex`). - Deleted `src/bin/pptx_video_presenter.rs` and the `x11rb` dependency — nothing here opens an X display any more. - `crate::config::PptxVideoConfig`: dropped `xvfb_path`, `window_manager_path`, `presenter_path`, `idle_end_seconds`. `mp4_enabled` now defaults **on** (my call, as the decision asked — the render has nothing left to default off *for*: no `Xvfb`, no recording, covered by the acceptance tests below). - `crate::playback_settings::effective_default_duration_seconds`: new public helper so `media::handlers::convert_pptx` can look up the uploading campus's configured page duration as the dwell time for a slide with no `advTm` of its own. - `crate::media::handlers::convert_pptx`: always renders slide images first, then tries the join on top of them — a join failure keeps the already-rendered images rather than re-running anything. - `plan/server/media-pipeline.md`, `plan/server/content-model.md`: updated for the new approach. ## Done when (forge #189 / GRI-2043) - [x] A `.pptx` with a fade and a push, one slide with `advTm` and one without: one video item; the slide times are `advTm` and the campus default; a frame mid-transition shows both slides — verified manually with real `soffice`/`gs`/`ffmpeg` on this host (fade and push frames both show the expected blend/slide; details in the forge comment). - [x] Unit tests for the XML reader and the transition map (one test per table row); acceptance test without `#[ignore]`. - [x] Due for the campus test, Monday 16 Nov. ## Test plan - `cargo test -p server --lib pptx_video` — 23/23 unit tests (XML reader, transition map table, timeline/offset arithmetic, filter-complex construction, the join and fallback paths against fake tools). - `cargo test -p server --test pptx_video_acceptance_integration` — 4/4, against a real Postgres, with fake `soffice`/`gs`/`ffmpeg`. - `./scripts/local-gates.sh --rust-only` — every gate green (fmt, clippy, `cargo deny` bans/licenses/sources, the full workspace test suite including the acceptance tests above, repo-boundary, pre-push hook). Pre-existing, branch-unrelated `cargo deny` advisories failure (RUSTSEC-2024-0429, glib via the client crate) unchanged. - Manual, real-tool verification on this host: built a deck with a fade transition + `advTm=500ms` on slide 2 and a push transition with no `advTm` on slide 3, ran it through the real `soffice`/`gs`/`ffmpeg` pipeline, and inspected frames mid-transition — both show the expected blend between slides.
GRI-2014: build .pptx video from slide images and xfade, not a recorded slideshow
Some checks failed
CI / the pre-push hook (pull_request) Successful in 8s
CI / cargo fmt (pull_request) Successful in 9s
CI / cargo deny (pull_request) Successful in 1m43s
CI / cargo deny advisories (pull_request) Failing after 1m43s
CI / cargo clippy (pull_request) Successful in 2m5s
CI / repository boundary (pull_request) Successful in 49s
CI / frontend-web (pull_request) Successful in 1m47s
CI / cargo test (pull_request) Successful in 3m44s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 16s
7e5a777f9c
Replaces the Xvfb-recorded render (PRs #190-#196), which could not be made
reliable against soffice's Tip-of-the-Day focus race. Reads each slide's
transition and advTm straight out of the .pptx XML, maps it to the closest
ffmpeg xfade effect, and joins the same slide images the fallback already
renders -- no display server, deterministic, and testable in CI without
soffice or ffmpeg installed. mp4_enabled now defaults on.
Author
Member

CI green on the gating CI / CI context (commit 7e5a777f): clippy, cargo deny bans/licenses/sources, fmt, cargo test, frontend-web, repository boundary, pre-push hook all pass. Only cargo deny advisories is red — the same pre-existing, branch-unrelated RUSTSEC-2024-0429 issue flagged on every PR in this chain (#190/#192/#193/#194/#196); this branch touches no Cargo.toml/Cargo.lock. Mergeable, no conflicts. Handing to the CTO for review/merge into dev.

CI green on the gating `CI / CI` context (commit 7e5a777f): clippy, cargo deny bans/licenses/sources, fmt, cargo test, frontend-web, repository boundary, pre-push hook all pass. Only `cargo deny advisories` is red — the same pre-existing, branch-unrelated RUSTSEC-2024-0429 issue flagged on every PR in this chain (#190/#192/#193/#194/#196); this branch touches no Cargo.toml/Cargo.lock. Mergeable, no conflicts. Handing to the CTO for review/merge into dev.
vivy merged commit 6b0d3fc1c6 into dev 2026-11-14 18:10:53 +00:00
vivy deleted branch feature/GRI-2014-pptx-xfade-video 2026-11-14 18:10:54 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!199
No description provided.