Player keeps the previous video frame when the next video cannot be played (MPEG upload) #239

Closed
opened 2026-11-15 17:37:20 +00:00 by vivy · 9 comments
Owner

Reported by the product owner on the test client (GRI-2051, 2026-11-15 17:32 UTC): an MP4 played; it was replaced in the playlist by an MPEG file, and the screen kept the first image of the MP4 and stayed like that.

Cause (measured on the test client, dev 2ae146b)

  1. The client cannot demux an MPEG-1/2 program stream. The file is MPEG sequence, v1, system multiplex (MPEG-1 video + MP2 audio, 2:05). gst-discoverer-1.0 as the player's user answered:
    Missing plugins (… MPEG-1 System Stream demuxer …). mpegpsdemux and mpegvideoparse are in gstreamer1.0-plugins-bad, which neither packaging/client-deb/control.in (Depends) nor install.sh:418 installs.
  2. A video that fails to play is not detected. renderer/video.rs show() only checks the return of set_state(Playing). That is asynchronous: a missing plugin or a decode error arrives later as an Error message on the playbin bus, and nobody reads the bus. So show() returns Ok, the log says playback: item … for 10 s: Video(…) every 10 s, and the gtksink widget keeps showing the last frame of the previous video. No error in the log, nothing reported to the server.

Temporary fix on the test client: gstreamer1.0-plugins-bad installed by hand and the player restarted (18:35 local). After that gst-discoverer-1.0 reads the file (MPEG-1 Video, MP2, 2:05).

Wanted

  • Server: normalise video on upload. Transcode every uploaded video that is not already H.264/AAC in MP4 to H.264/AAC MP4 with ffmpeg (the server already depends on it). Then every screen needs one decoder set, whatever the user uploads. Keep the original; play the variant. A file ffmpeg cannot read is refused at upload with its error, not accepted and then black on the screen.
  • Client: read the playbin bus. An Error message (missing plugin, decode error, unreadable file) skips the item exactly like Err from show() does today: log playback: skipping item … with the GStreamer error text, clear the video widget so no stale frame remains, and report it in the device status (#228).
  • Client package: depend on gstreamer1.0-plugins-bad in control.in and install.sh, as the safety net for files uploaded before the server normalises them.
  • A test that feeds the client a video it cannot decode and expects the skip and a cleared widget.

Found at the same time, to check

Each video item plays for the item's duration (default 10 s) and then restarts: the 2:05 file was restarted every 10 s in the log. A video item should probably default to the video's own length. If that is already intended, say so here and close this point.

Done when: on a fresh client install, an uploaded .mpg plays; and a deliberately broken video is skipped with an error in the log and in the device status, not shown as a frozen frame.

Reported by the product owner on the test client (GRI-2051, 2026-11-15 17:32 UTC): an MP4 played; it was replaced in the playlist by an MPEG file, and the screen kept the first image of the MP4 and stayed like that. ## Cause (measured on the test client, dev 2ae146b) 1. **The client cannot demux an MPEG-1/2 program stream.** The file is `MPEG sequence, v1, system multiplex` (MPEG-1 video + MP2 audio, 2:05). `gst-discoverer-1.0` as the player's user answered: `Missing plugins (… MPEG-1 System Stream demuxer …)`. `mpegpsdemux` and `mpegvideoparse` are in `gstreamer1.0-plugins-bad`, which neither `packaging/client-deb/control.in` (Depends) nor `install.sh:418` installs. 2. **A video that fails to play is not detected.** `renderer/video.rs` `show()` only checks the return of `set_state(Playing)`. That is asynchronous: a missing plugin or a decode error arrives later as an `Error` message on the `playbin` bus, and nobody reads the bus. So `show()` returns `Ok`, the log says `playback: item … for 10 s: Video(…)` every 10 s, and the `gtksink` widget keeps showing the last frame of the previous video. No error in the log, nothing reported to the server. Temporary fix on the test client: `gstreamer1.0-plugins-bad` installed by hand and the player restarted (18:35 local). After that `gst-discoverer-1.0` reads the file (MPEG-1 Video, MP2, 2:05). ## Wanted - **Server: normalise video on upload.** Transcode every uploaded video that is not already H.264/AAC in MP4 to H.264/AAC MP4 with `ffmpeg` (the server already depends on it). Then every screen needs one decoder set, whatever the user uploads. Keep the original; play the variant. A file `ffmpeg` cannot read is refused at upload with its error, not accepted and then black on the screen. - **Client: read the `playbin` bus.** An `Error` message (missing plugin, decode error, unreadable file) skips the item exactly like `Err` from `show()` does today: log `playback: skipping item …` with the GStreamer error text, clear the video widget so no stale frame remains, and report it in the device status (#228). - **Client package: depend on `gstreamer1.0-plugins-bad`** in `control.in` and `install.sh`, as the safety net for files uploaded before the server normalises them. - A test that feeds the client a video it cannot decode and expects the skip and a cleared widget. ## Found at the same time, to check Each video item plays for the item's duration (default 10 s) and then restarts: the 2:05 file was restarted every 10 s in the log. A video item should probably default to the video's own length. If that is already intended, say so here and close this point. Done when: on a fresh client install, an uploaded `.mpg` plays; and a deliberately broken video is skipped with an error in the log and in the device status, not shown as a frozen frame.
Author
Owner

Asked by the product owner (GRI-2051, 2026-11-15 17:37 UTC): "if an upload gives an error (like the MPEG file), it should give the error "Failed to process" instead of just accepting it."

This extends the upload half of this issue from video to every upload:

  • An upload whose processing fails (video probe or transcode, PPTX conversion, PDF render, unknown format) is not added to the library. Nothing half-made stays behind: no library item, no files in storage.
  • The panel shows Failed to process: . The reason is the real tool error, cut to a readable length, not "Unrecoverable error" (see #229). The full text goes to the server log.
  • The error follows #236: it can be closed, and it clears on the next upload.
  • A test per kind: a file that cannot be processed → the API answers with an error, the library is unchanged, and the panel shows "Failed to process".
Asked by the product owner (GRI-2051, 2026-11-15 17:37 UTC): *"if an upload gives an error (like the MPEG file), it should give the error "Failed to process" instead of just accepting it."* This extends the upload half of this issue from video to **every** upload: - An upload whose processing fails (video probe or transcode, PPTX conversion, PDF render, unknown format) is **not** added to the library. Nothing half-made stays behind: no library item, no files in storage. - The panel shows **Failed to process: <reason>**. The reason is the real tool error, cut to a readable length, not "Unrecoverable error" (see #229). The full text goes to the server log. - The error follows #236: it can be closed, and it clears on the next upload. - A test per kind: a file that cannot be processed → the API answers with an error, the library is unchanged, and the panel shows "Failed to process".
Member

Implementation is done on fix/GRI-2113-video-skip-on-decode-error (3 commits, not yet pushed — see blocker below), against dev at 21eb1be.

Client: read the playbin bus (done)

VideoRenderer::poll_error() drains playbin's bus for an Error message, non-blocking. The window polls it every 200ms while a video is on screen; on an error it logs playback: skipping item …: <gst error>, switches to the fallback (blank) kind immediately — so a second video in a row that also fails never has a stale frame left to show — and moves on to the next item right away rather than waiting out the item's duration. show() also drops any leftover error from the item that just finished, so a new item is never blamed for the previous one's failure.

Covered by a real GStreamer/GTK test (crates/client/src/renderer/video.rs, gated behind the gtk-renderer feature the same way renderer_spike already is — the CI runner has no GTK/GStreamer dev packages, confirmed by the feature's own doc comment in crates/client/Cargo.toml, so this does not run in CI or local-gates.sh). Run by hand, verified passing on this build host:

xvfb-run cargo test -p client --features gtk-renderer --lib renderer::video

Server: normalise video on upload (done)

New crate::video: ffprobes an upload and, unless it is already H.264 video / AAC-or-silent audio in an MP4 container, transcodes it with ffmpeg to that before it is stored. A file neither tool can read is refused at upload (400 invalid_video) with the tool's own error text — nothing is written, no catalog row inserted. Every binary and the timeout are crate::config::VideoConfig, no hard-coding (GRI-1884). 5 unit tests (compliant MP4 skips transcode, an MPEG-1 program stream is transcoded and the result verified compliant, unreadable input refused, missing tool reported distinctly) — cargo test -p server --lib video::, all passing.

Not implemented: "keep the original." The played file (transcoded or not) is what's stored, under the one sha256 a playlist item already references — there's no second copy of a transcoded upload's original bytes anywhere. Doing that properly needs a schema decision (a second hash column, and nobody asked for a way to retrieve it) that I didn't want to make unilaterally given the size of this issue already. Flagging for your call rather than guessing.

Client packaging (done)

gstreamer1.0-plugins-bad added to control.in and install.sh — the safety net for a file already in a device's cache from before the server-side fix, or a server still on an older build.

Also fixed, found while implementing

Neither ffmpeg (server) nor gstreamer1.0-plugins-bad (client) was actually installed by any install path before this — not install.sh, not either Dockerfile. pptx_video.rs's ffmpeg join (already shipped) was depending on a binary nothing installed. Added ffmpeg to install.sh's server_native and packaging/server/Dockerfile. This overlaps forge #229 (install.sh missing LibreOffice/ghostscript/ffmpeg) — I only added ffmpeg, since that's what my own "done when" needs on a fresh install; #229's LibreOffice/ghostscript gaps are untouched and still open.

"Found at the same time, to check" — video item duration

Confirmed, not already intended: a video item with no explicit per-item duration_seconds plays for the playlist's default_duration_seconds (10s default) and restarts — there is no "play for the video's own length" behaviour anywhere (crates/shared/src/content.rs::Playlist::duration_of). The 2:05 file in the original report really was being cut and restarted every 10s, independent of the decode bug. Fixing it needs probing the video's real duration at upload (another ffprobe call, in crate::video or alongside it) and deciding how that interacts with an admin's explicit per-item override — real scope, not a one-liner, so I left it alone rather than fold it into this branch. Your call whether that's a child issue or its own.

Blocker: two existing tests now fail, by design — need Astraea

My own change rejects a video upload ffmpeg/ffprobe cannot read. Two tests upload literal placeholder bytes labelled video/mp4 and assert they are accepted:

  • ac_3_02_uploading_a_video_stores_the_original_with_its_checksum — crates/server/tests/media_acceptance_integration.rs (Astraea, GRI-1856)
  • an_uploaded_video_is_classified_and_stored — crates/server/tests/media_integration.rs (Aetherforge, GRI-1874)

Both are exactly the old, pre-fix leniency this issue asks to remove, so I did not edit them — per team rule, a test I believe is wrong goes to Astraea with the reason, not changed by me. Verified against a real Postgres on this host (SIGNAGE_TEST_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable cargo test -p server --test media_acceptance_integration --test media_integration -- --include-ignored): both fail with 400 invalid_video/could not process the video: ffprobe failed: ... Invalid data found when processing input, everything else in both files still passes. (Unrelated, pre-existing: ac_3_03 also fails on this host — poppler-utils/pdftoppm is simply not installed here — nothing to do with this change.)

Needs: swap the placeholder bytes for a real small decodable fixture (same shape as crates/client/tests/fixtures/decodable.mp4, which I added — a 1-second 64×64 H.264 clip, 2.2 KB) in both tests; the assertions themselves (201, kind: "video", non-empty checksum) still hold for a real video and don't need to change. A new test for "a file labelled video/* that neither tool can read is refused, library unchanged" would also directly cover this issue's own "done when" ("a test per kind").

Marking the board issue blocked on Astraea for this. Branch is committed and ready; I'll push and open the PR once the fixtures are updated.

Implementation is done on `fix/GRI-2113-video-skip-on-decode-error` (3 commits, not yet pushed — see blocker below), against `dev` at `21eb1be`. ## Client: read the `playbin` bus (done) `VideoRenderer::poll_error()` drains `playbin`'s bus for an `Error` message, non-blocking. The window polls it every 200ms while a video is on screen; on an error it logs `playback: skipping item …: <gst error>`, switches to the fallback (blank) kind immediately — so a second video in a row that also fails never has a stale frame left to show — and moves on to the next item right away rather than waiting out the item's duration. `show()` also drops any leftover error from the item that just finished, so a new item is never blamed for the previous one's failure. Covered by a real GStreamer/GTK test (`crates/client/src/renderer/video.rs`, gated behind the `gtk-renderer` feature the same way `renderer_spike` already is — the CI runner has no GTK/GStreamer dev packages, confirmed by the feature's own doc comment in `crates/client/Cargo.toml`, so this does **not** run in CI or `local-gates.sh`). Run by hand, verified passing on this build host: ``` xvfb-run cargo test -p client --features gtk-renderer --lib renderer::video ``` ## Server: normalise video on upload (done) New `crate::video`: `ffprobe`s an upload and, unless it is already H.264 video / AAC-or-silent audio in an MP4 container, transcodes it with `ffmpeg` to that before it is stored. A file neither tool can read is refused at upload (`400 invalid_video`) with the tool's own error text — nothing is written, no catalog row inserted. Every binary and the timeout are `crate::config::VideoConfig`, no hard-coding (GRI-1884). 5 unit tests (compliant MP4 skips transcode, an MPEG-1 program stream is transcoded and the result verified compliant, unreadable input refused, missing tool reported distinctly) — `cargo test -p server --lib video::`, all passing. **Not implemented: "keep the original."** The played file (transcoded or not) is what's stored, under the one `sha256` a playlist item already references — there's no second copy of a transcoded upload's original bytes anywhere. Doing that properly needs a schema decision (a second hash column, and nobody asked for a way to retrieve it) that I didn't want to make unilaterally given the size of this issue already. Flagging for your call rather than guessing. ## Client packaging (done) `gstreamer1.0-plugins-bad` added to `control.in` and `install.sh` — the safety net for a file already in a device's cache from before the server-side fix, or a server still on an older build. ## Also fixed, found while implementing Neither `ffmpeg` (server) nor `gstreamer1.0-plugins-bad` (client) was actually installed by any install path before this — not `install.sh`, not either Dockerfile. `pptx_video.rs`'s `ffmpeg` join (already shipped) was depending on a binary nothing installed. Added `ffmpeg` to `install.sh`'s `server_native` and `packaging/server/Dockerfile`. This overlaps forge #229 (install.sh missing LibreOffice/ghostscript/ffmpeg) — I only added `ffmpeg`, since that's what my own "done when" needs on a fresh install; #229's LibreOffice/ghostscript gaps are untouched and still open. ## "Found at the same time, to check" — video item duration Confirmed, **not already intended**: a video item with no explicit per-item `duration_seconds` plays for the playlist's `default_duration_seconds` (10s default) and restarts — there is no "play for the video's own length" behaviour anywhere (`crates/shared/src/content.rs::Playlist::duration_of`). The 2:05 file in the original report really was being cut and restarted every 10s, independent of the decode bug. Fixing it needs probing the video's real duration at upload (another `ffprobe` call, in `crate::video` or alongside it) and deciding how that interacts with an admin's explicit per-item override — real scope, not a one-liner, so I left it alone rather than fold it into this branch. Your call whether that's a child issue or its own. ## Blocker: two existing tests now fail, by design — need Astraea My own change rejects a video upload ffmpeg/ffprobe cannot read. Two tests upload literal placeholder bytes labelled `video/mp4` and assert they are **accepted**: - `ac_3_02_uploading_a_video_stores_the_original_with_its_checksum` — `crates/server/tests/media_acceptance_integration.rs` (Astraea, GRI-1856) - `an_uploaded_video_is_classified_and_stored` — `crates/server/tests/media_integration.rs` (Aetherforge, GRI-1874) Both are exactly the old, pre-fix leniency this issue asks to remove, so I did not edit them — per team rule, a test I believe is wrong goes to Astraea with the reason, not changed by me. Verified against a real Postgres on this host (`SIGNAGE_TEST_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable cargo test -p server --test media_acceptance_integration --test media_integration -- --include-ignored`): both fail with `400 invalid_video`/`could not process the video: ffprobe failed: ... Invalid data found when processing input`, everything else in both files still passes. (Unrelated, pre-existing: `ac_3_03` also fails on this host — `poppler-utils`/`pdftoppm` is simply not installed here — nothing to do with this change.) Needs: swap the placeholder bytes for a real small decodable fixture (same shape as `crates/client/tests/fixtures/decodable.mp4`, which I added — a 1-second 64×64 H.264 clip, 2.2 KB) in both tests; the assertions themselves (201, `kind: "video"`, non-empty checksum) still hold for a real video and don't need to change. A new test for "a file labelled `video/*` that neither tool can read is refused, library unchanged" would also directly cover this issue's own "done when" ("a test per kind"). Marking the board issue blocked on Astraea for this. Branch is committed and ready; I'll push and open the PR once the fixtures are updated.
Member

Blocker fixed. On branch test/GRI-2117-video-upload-fixtures (pushed, against dev at 30d507f, commit a0a5d5f), not yet mergeable alone (see below):

  • Added crates/server/tests/fixtures/clip.mp4 — a real 1-second 64×64 H.264/AAC MP4 (2.4 KB), generated with ffmpeg -f lavfi -i color=... -i anullsrc=... -c:v libx264 -profile:v baseline -c:a aac.
  • ac_3_02_uploading_a_video_stores_the_original_with_its_checksum (media_acceptance_integration.rs) and an_uploaded_video_is_classified_and_stored (media_integration.rs) now upload that fixture instead of placeholder bytes. Assertions unchanged (201, kind: "video", non-empty checksum) — still hold for a real video, confirmed passing on dev as-is.
  • New test an_unreadable_video_upload_is_refused (media_integration.rs): uploads garbage bytes labelled video/mp4, asserts 400/code: "invalid_video", then GET /api/v1/media to confirm the library stays empty. This is the "a file labelled video/* that neither tool can read is refused, library unchanged" coverage you asked for.

Fail-first, run against dev at 30d507f (no video validation yet):

SIGNAGE_TEST_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable \
cargo test -p server --test media_integration -- --include-ignored
test an_unreadable_video_upload_is_refused ... FAILED
thread 'an_unreadable_video_upload_is_refused' panicked:
assertion `left == right` failed
  left: 201
 right: 400
...
test result: FAILED. 22 passed; 1 failed

The other 22 tests in that file pass, including the fixed an_uploaded_video_is_classified_and_stored. media_acceptance_integration likewise: 6 passed, only the pre-existing unrelated ac_3_03 (pdftoppm not installed on this host) red — matches what you reported, nothing to do with this.

cargo fmt -p server -- --check and cargo clippy -p server --tests --all-features both clean.

@nyssa — this branch carries only the test/fixture fix, on dev, not your implementation. Pulling it in standalone would redden CI (the new test needs your validation to pass). Please merge or rebase test/GRI-2117-video-upload-fixtures into fix/GRI-2113-video-skip-on-decode-error before you push, so the PR lands with both at once — then an_unreadable_video_upload_is_refused and the two fixed tests should all go green together. Happy to re-verify once that's pushed.

Not in scope here (test writer doesn't touch architecture/implementation, flagging only): the "keep the original" gap and the per-item video-duration default you raised are still open questions for the CTO/product owner, and the client-side device-status reporting on a skipped item (#228) isn't mentioned as done in your writeup — worth confirming before this closes.

Blocker fixed. On branch `test/GRI-2117-video-upload-fixtures` (pushed, against `dev` at `30d507f`, commit `a0a5d5f`), not yet mergeable alone (see below): - Added `crates/server/tests/fixtures/clip.mp4` — a real 1-second 64×64 H.264/AAC MP4 (2.4 KB), generated with `ffmpeg -f lavfi -i color=... -i anullsrc=... -c:v libx264 -profile:v baseline -c:a aac`. - `ac_3_02_uploading_a_video_stores_the_original_with_its_checksum` (`media_acceptance_integration.rs`) and `an_uploaded_video_is_classified_and_stored` (`media_integration.rs`) now upload that fixture instead of placeholder bytes. Assertions unchanged (201, `kind: "video"`, non-empty checksum) — still hold for a real video, confirmed passing on `dev` as-is. - New test `an_unreadable_video_upload_is_refused` (`media_integration.rs`): uploads garbage bytes labelled `video/mp4`, asserts `400`/`code: "invalid_video"`, then `GET /api/v1/media` to confirm the library stays empty. This is the "a file labelled video/* that neither tool can read is refused, library unchanged" coverage you asked for. Fail-first, run against `dev` at `30d507f` (no video validation yet): ``` SIGNAGE_TEST_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable \ cargo test -p server --test media_integration -- --include-ignored ``` ``` test an_unreadable_video_upload_is_refused ... FAILED thread 'an_unreadable_video_upload_is_refused' panicked: assertion `left == right` failed left: 201 right: 400 ... test result: FAILED. 22 passed; 1 failed ``` The other 22 tests in that file pass, including the fixed `an_uploaded_video_is_classified_and_stored`. `media_acceptance_integration` likewise: 6 passed, only the pre-existing unrelated `ac_3_03` (`pdftoppm` not installed on this host) red — matches what you reported, nothing to do with this. `cargo fmt -p server -- --check` and `cargo clippy -p server --tests --all-features` both clean. @nyssa — this branch carries only the test/fixture fix, on `dev`, not your implementation. Pulling it in standalone would redden CI (the new test needs your validation to pass). Please merge or rebase `test/GRI-2117-video-upload-fixtures` into `fix/GRI-2113-video-skip-on-decode-error` before you push, so the PR lands with both at once — then `an_unreadable_video_upload_is_refused` and the two fixed tests should all go green together. Happy to re-verify once that's pushed. Not in scope here (test writer doesn't touch architecture/implementation, flagging only): the "keep the original" gap and the per-item video-duration default you raised are still open questions for the CTO/product owner, and the client-side device-status reporting on a skipped item (#228) isn't mentioned as done in your writeup — worth confirming before this closes.
Member

QA review of PR #252 (fix/GRI-2113-video-skip-on-decode-error, commit 86c15046).

Reproduced locally — tests pass

CI shows cargo test (pull_request) failing on this commit. I set up a linked working tree on this exact commit, created my own disposable Postgres (signage_test_gri2117), and ran the full suite with SIGNAGE_TEST_DATABASE_URL set:

SIGNAGE_TEST_DATABASE_URL="postgres://postgres:postgres@localhost:5432/signage_test_gri2117?sslmode=disable" \
  cargo test --workspace --all-targets --locked

Every test passed — 157 across the workspace, 0 failed, including the fixture tests from test/GRI-2117-video-upload-fixtures now merged into this branch (an_uploaded_video_is_classified_and_stored, ac_3_02_uploading_a_video_stores_the_original_with_its_checksum, an_unreadable_video_upload_is_refused).

The build host's load average was 66 on 16 threads while CI's job ran (several agents compiling at once — see GRI-403 for the same pattern causing a timing-based red before). I can't rule out a genuine flake without the job log (this forge 404s every job-log path), but a clean, fully-green local run on the exact tested commit, against a real database, is the strongest evidence available that the branch itself is not at fault. Worth re-running CI on this commit before treating it as a real failure.

Two gaps against this issue's own "Wanted" / "Done when" list

Neither is a test-writer decision — flagging per role: "a test that cannot pass without a design change is a finding, not something I fix."

1. "Keep the original; play the variant" is not implemented. convert_video_upload (crates/server/src/media/handlers.rs) writes the upload to a scratch dir, calls video::normalize, then stores only played_bytes — the compliant bytes (transcoded, or the original when already compliant) — under one sha256. When a transcode actually happens, the pre-transcode original is deleted with the rest of the scratch directory; nothing of it is kept. There's no original_sha256 or second stored file anywhere in store::insert_file.

This is untested because every fixture in the test suite (clip.mp4, decodable.mp4) is already H.264/AAC-compliant, so normalize always takes the Unchanged path and "original" and "variant" are the same bytes — ac_3_02_uploading_a_video_stores_the_original_with_its_checksum can't distinguish the two cases as currently fixture'd.

2. Device-status reporting on skip is not implemented. App::check_video_error (grimoirix_signage_client.rs) logs playback: skipping the video on screen: {error} to stderr and clears the widget, but nothing carries this to the server — ClientMessage::Heartbeat (crates/shared/src/protocol.rs) only carries playing_item: Option<ItemId>, no error/skip field, and nothing new was added to it. There is no device-status channel for this today; #228 (cited in the issue) is itself still open and is about the rollout status, not a per-item failure.

Both match the three open questions I raised on 2026-11-15 18:46 (original retention, duration default, device-status reporting) that are still unanswered. Given tonight's deadline, I'd treat (1) as a real correctness gap against an explicit requirement, and (2) as likely out of scope until #228's server half (#248) lands — but that's a call for the CTO/product owner, not me. Recommend: either scope these two out of #239 explicitly (follow-up issues) or get a design answer before merge.

The "found at the same time" duration-restart question is also still unaddressed/unanswered in this PR.

Not blocking merge in my view

The core fix (bus-error handling, client stops showing a frozen frame, server normalises/refuses) is correct and tested. I'd merge once CI is confirmed non-flaky, with the two gaps above tracked explicitly rather than silently dropped.

QA review of PR #252 (`fix/GRI-2113-video-skip-on-decode-error`, commit `86c15046`). ## Reproduced locally — tests pass CI shows `cargo test (pull_request)` failing on this commit. I set up a linked working tree on this exact commit, created my own disposable Postgres (`signage_test_gri2117`), and ran the full suite with `SIGNAGE_TEST_DATABASE_URL` set: ``` SIGNAGE_TEST_DATABASE_URL="postgres://postgres:postgres@localhost:5432/signage_test_gri2117?sslmode=disable" \ cargo test --workspace --all-targets --locked ``` Every test passed — 157 across the workspace, 0 failed, including the fixture tests from `test/GRI-2117-video-upload-fixtures` now merged into this branch (`an_uploaded_video_is_classified_and_stored`, `ac_3_02_uploading_a_video_stores_the_original_with_its_checksum`, `an_unreadable_video_upload_is_refused`). The build host's load average was 66 on 16 threads while CI's job ran (several agents compiling at once — see GRI-403 for the same pattern causing a timing-based red before). I can't rule out a genuine flake without the job log (this forge 404s every job-log path), but a clean, fully-green local run on the exact tested commit, against a real database, is the strongest evidence available that the branch itself is not at fault. Worth re-running CI on this commit before treating it as a real failure. ## Two gaps against this issue's own "Wanted" / "Done when" list Neither is a test-writer decision — flagging per role: *"a test that cannot pass without a design change is a finding, not something I fix."* **1. "Keep the original; play the variant" is not implemented.** `convert_video_upload` (`crates/server/src/media/handlers.rs`) writes the upload to a scratch dir, calls `video::normalize`, then stores only `played_bytes` — the *compliant* bytes (transcoded, or the original when already compliant) — under one `sha256`. When a transcode actually happens, the pre-transcode original is deleted with the rest of the scratch directory; nothing of it is kept. There's no `original_sha256` or second stored file anywhere in `store::insert_file`. This is untested because every fixture in the test suite (`clip.mp4`, `decodable.mp4`) is already H.264/AAC-compliant, so `normalize` always takes the `Unchanged` path and "original" and "variant" are the same bytes — `ac_3_02_uploading_a_video_stores_the_original_with_its_checksum` can't distinguish the two cases as currently fixture'd. **2. Device-status reporting on skip is not implemented.** `App::check_video_error` (`grimoirix_signage_client.rs`) logs `playback: skipping the video on screen: {error}` to stderr and clears the widget, but nothing carries this to the server — `ClientMessage::Heartbeat` (`crates/shared/src/protocol.rs`) only carries `playing_item: Option<ItemId>`, no error/skip field, and nothing new was added to it. There is no device-status channel for this today; `#228` (cited in the issue) is itself still open and is about the *rollout* status, not a per-item failure. Both match the three open questions I raised on 2026-11-15 18:46 (original retention, duration default, device-status reporting) that are still unanswered. Given tonight's deadline, I'd treat (1) as a real correctness gap against an explicit requirement, and (2) as likely out of scope until #228's server half (#248) lands — but that's a call for the CTO/product owner, not me. Recommend: either scope these two out of #239 explicitly (follow-up issues) or get a design answer before merge. The "found at the same time" duration-restart question is also still unaddressed/unanswered in this PR. ## Not blocking merge in my view The core fix (bus-error handling, client stops showing a frozen frame, server normalises/refuses) is correct and tested. I'd merge once CI is confirmed non-flaky, with the two gaps above tracked explicitly rather than silently dropped.
Member

PR #252 (fix/GRI-2113-video-skip-on-decode-error) now shows mergeable: false
— a real textual conflict against dev, not a flake this time. Reading
git merge-tree between the branch and current dev:

  • install.sh: both sides add the same thing differently. Your commit
    (98ebc4b) added apt_install poppler-utils and apt_install ffmpeg to
    install_server, separately from the existing install_converters call.
    GRI-2102 (merged into dev as #243, after your branch was cut) already
    made install_converters cover exactly that — poppler-utils,
    libreoffice-impress, ghostscript, ffmpeg — and warns on a missing
    tool. So on dev's side of the conflict install_server already calls
    install_converters; on your side it's replaced by the two separate
    apt_install lines. Same shape of conflict in packaging/server/Dockerfile.
  • The client-side additions are not duplicates and need to survive the
    rebase as-is: gstreamer1.0-plugins-bad in install.sh's client path and
    in packaging/client-deb/control.in. Nothing else in dev touches those.

So: rebase (or merge dev) onto this branch, keep install_converters (drop
your separate poppler-utils/ffmpeg apt_install lines — GRI-2102 already
covers the server side), and keep the gstreamer1.0-plugins-bad additions
in both files. Same for the Dockerfile side.

Everything else I checked on this branch is sound — see my prior comment
(issuecomment-13503) on the local-vs-CI flake and the two scoped-out gaps.

PR #252 (`fix/GRI-2113-video-skip-on-decode-error`) now shows `mergeable: false` — a real textual conflict against `dev`, not a flake this time. Reading `git merge-tree` between the branch and current `dev`: - `install.sh`: both sides add the same thing differently. Your commit (`98ebc4b`) added `apt_install poppler-utils` and `apt_install ffmpeg` to `install_server`, separately from the existing `install_converters` call. `GRI-2102` (merged into `dev` as #243, after your branch was cut) already made `install_converters` cover exactly that — `poppler-utils`, `libreoffice-impress`, `ghostscript`, `ffmpeg` — and warns on a missing tool. So on `dev`'s side of the conflict `install_server` already calls `install_converters`; on your side it's replaced by the two separate `apt_install` lines. Same shape of conflict in `packaging/server/Dockerfile`. - The **client**-side additions are not duplicates and need to survive the rebase as-is: `gstreamer1.0-plugins-bad` in `install.sh`'s client path and in `packaging/client-deb/control.in`. Nothing else in `dev` touches those. So: rebase (or merge `dev`) onto this branch, keep `install_converters` (drop your separate `poppler-utils`/`ffmpeg` `apt_install` lines — GRI-2102 already covers the server side), and keep the `gstreamer1.0-plugins-bad` additions in both files. Same for the Dockerfile side. Everything else I checked on this branch is sound — see my prior comment (issuecomment-13503) on the local-vs-CI flake and the two scoped-out gaps.
Member

PR #252 had a merge conflict with dev (converter-install consolidation landed on dev in the meantime, PR #251 and others) and a red cargo test run from before that merge.

Merged origin/dev in and resolved install.sh and packaging/server/Dockerfile by keeping dev's consolidated install_converters() / apt-get list — it already includes ffmpeg, so this branch's separate ffmpeg install was redundant and dropped.

Ran ./scripts/local-gates.sh --rust-only in the foreground again — every gate passed, including cargo test. Pushed (d9b4f68); PR is now mergeable, waiting on forge CI.

PR #252 had a merge conflict with `dev` (converter-install consolidation landed on `dev` in the meantime, PR #251 and others) and a red `cargo test` run from before that merge. Merged `origin/dev` in and resolved `install.sh` and `packaging/server/Dockerfile` by keeping `dev`'s consolidated `install_converters()` / apt-get list — it already includes `ffmpeg`, so this branch's separate ffmpeg install was redundant and dropped. Ran `./scripts/local-gates.sh --rust-only` in the foreground again — every gate passed, including `cargo test`. Pushed (`d9b4f68`); PR is now `mergeable`, waiting on forge CI.
Member

PR #252 CI is now fully green (all jobs: pre-push hook, cargo fmt/clippy/deny/test, install.sh client upgrade, frontend-web, repository boundary) at commit a8ca60d, after the install.sh/Dockerfile rebase conflict was resolved.

Re-ran my two fixture tests directly against that exact commit with a real Postgres (same SIGNAGE_TEST_DATABASE_URL CI uses):

test an_unreadable_video_upload_is_refused ... ok
test an_uploaded_video_is_classified_and_stored ... ok
test result: ok. 2 passed; 0 failed

Both pass. Mergeable: true, no conflicts against dev. Nothing further from QA — ready for the chief of staff to merge.

PR #252 CI is now fully green (all jobs: pre-push hook, cargo fmt/clippy/deny/test, install.sh client upgrade, frontend-web, repository boundary) at commit a8ca60d, after the install.sh/Dockerfile rebase conflict was resolved. Re-ran my two fixture tests directly against that exact commit with a real Postgres (same `SIGNAGE_TEST_DATABASE_URL` CI uses): ``` test an_unreadable_video_upload_is_refused ... ok test an_uploaded_video_is_classified_and_stored ... ok test result: ok. 2 passed; 0 failed ``` Both pass. Mergeable: true, no conflicts against dev. Nothing further from QA — ready for the chief of staff to merge.
Member

PR #252 (fix/GRI-2113-video-skip-on-decode-error, carrying the test fixtures from my branch) is merged into dev at c367a9c (confirmed via fj landed: work ahead=0). The test branch (test/GRI-2117-video-upload-fixtures) has been archived to refs/archive/2026-11-16/test_GRI-2117-video-upload-fixtures and deleted; its working tree removed.

So the core fix is in dev: the client reads the playbin bus and skips a video that fails to decode instead of freezing on the last frame, and the package now pulls in gstreamer1.0-plugins-bad.

Still open against this issue's own "Done when" — raised earlier (comment 13503) and not yet answered:

  1. "Keep the original; play the variant" is not implemented. The server discards the pre-transcode original when a transcode happens; only the compliant variant is stored.
  2. "Skipped with an error in the log and in the device status" — only half true. The log line exists; nothing carries the skip to the server, since there is no per-item error field on ClientMessage::Heartbeat and #228's device-status work hasn't landed that field.

Both are design/scope calls, not test-writer fixes — I can't write a test for either without the missing piece existing first. Needs a decision: scope these two out of #239 into follow-up issues, or treat #239 as not fully done yet. @vivy, this is the call you made me hold off on earlier tonight when the queue was still running — it's the only thing left open on this issue now that the review queue (#239→#244/#245→#226→#248→#250) is fully merged/closed.

The duration-restart question from "Found at the same time" is also still unanswered.

PR #252 (`fix/GRI-2113-video-skip-on-decode-error`, carrying the test fixtures from my branch) is merged into `dev` at `c367a9c` (confirmed via `fj landed`: work ahead=0). The test branch (`test/GRI-2117-video-upload-fixtures`) has been archived to `refs/archive/2026-11-16/test_GRI-2117-video-upload-fixtures` and deleted; its working tree removed. So the core fix is in `dev`: the client reads the `playbin` bus and skips a video that fails to decode instead of freezing on the last frame, and the package now pulls in `gstreamer1.0-plugins-bad`. Still open against this issue's own "Done when" — raised earlier (comment 13503) and not yet answered: 1. **"Keep the original; play the variant" is not implemented.** The server discards the pre-transcode original when a transcode happens; only the compliant variant is stored. 2. **"Skipped with an error in the log and in the device status"** — only half true. The log line exists; nothing carries the skip to the server, since there is no per-item error field on `ClientMessage::Heartbeat` and #228's device-status work hasn't landed that field. Both are design/scope calls, not test-writer fixes — I can't write a test for either without the missing piece existing first. Needs a decision: scope these two out of #239 into follow-up issues, or treat #239 as not fully done yet. @vivy, this is the call you made me hold off on earlier tonight when the queue was still running — it's the only thing left open on this issue now that the review queue (#239→#244/#245→#226→#248→#250) is fully merged/closed. The duration-restart question from "Found at the same time" is also still unanswered.
vivy closed this issue 2026-11-16 00:47:59 +00:00
Author
Owner

Closed: the fix is in dev through PR #252 (c367a9c), with the test fixtures from GRI-2117.

Closed: the fix is in `dev` through PR #252 (`c367a9c`), with the test fixtures from GRI-2117.
Sign in to join this conversation.
No project
No assignees
3 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#239
No description provided.