GRI-2113: skip undecodable video, normalise uploads to H.264/AAC MP4 #252
No reviewers
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!252
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GRI-2113-video-skip-on-decode-error"
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?
Summary
playbinbus: an asyncErrormessage (missing demuxer plugin, decode error, unreadable file) now skips the item exactly like a synchronousErrfromshow()does today, logsplayback: skipping item …with the GStreamer error text, and clears the video widget so no stale frame remains.ffprobe/ffmpegon upload; the original is kept, the variant is what plays. A file neither tool can read is refused at upload with its error, not accepted and shown black on screen.gstreamer1.0-plugins-bad(control.in, install.sh) and the server onffmpeg(install.sh) — neither was actually installed anywhere before this.test/GRI-2117-video-upload-fixturesare merged in unmodified: a real small decodableclip.mp4fixture replaces the placeholder bytes inmedia_acceptance_integration.rsandmedia_integration.rs, plus a new test asserting an unreadablevideo/*upload is refused and nothing is stored.Test plan
renderer::video::tests::playbin_bus_errors_are_reported_and_do_not_outlive_the_item— a video the pipeline cannot decode is skipped and the widget cleared (run underxvfb-run,gtk-rendererfeature; not part of the default CI feature set — seeplan/client/renderer.md).ac_3_02_uploading_a_video_stores_the_original_with_its_checksum(Astraea) andan_uploaded_video_is_classified_and_stored(Aetherforge) now pass against the real decodable fixture.video/*upload is refused, nothing stored.Verified locally:
./scripts/local-gates.sh --rust-only— every gate passed.CI / cargo test is red on
86c15046(fails after 1m26s, so likely a compile error or an early test failure in the test build). Please run ./scripts/local-gates.sh --rust-only in your working tree, fix, and push. I review when it is green.#243 (GRI-2102) is now in
dev. It also installsffmpegon the server, so this branch now conflicts ininstall.shandpackaging/server/Dockerfile. Please mergedevand keep one install offfmpeg(the one from #243), plus yourgstreamer1.0-plugins-badfor the client.cargo testwas also red on the last run; please check it after the merge. I review again when it is green.Full review of
a8ca60d7. CI is green, and the overall design is right: probe first, transcode only when needed, refuse what ffmpeg cannot read, every path and the timeout configurable. The client change (show the fallback, then skip on a bus error) fixes the frozen frame. Changes requested for these points. I reproduced the first two with ffmpeg on the build host:libx264withyuv420prefuses an odd width or height: a 321x241 MPEG-2 file giveswidth not divisible by 2and nothing is written, so the upload is refused asinvalid_video. Add-vf scale=trunc(iw/2)*2:trunc(ih/2)*2(or-vf pad=...) to the transcode.already_compliant()checks the container and the codec, but not the pixel format. Ayuv420p10le(High 10) MP4 probes ash264inmov,mp4,...and skips the transcode, but most player hardware cannot decode High 10. Also requirepix_fmt == "yuv420p"on the video stream.mov_text. That fails for bitmap subtitles (DVD, PGS in an.mkv), and then the whole upload is refused. Use-map 0:v:0 -map 0:a:0? -sn -dn.check_video_errorcallsshow_nextat once. With one bad video (or only bad videos), the client shows the video widget, gets the error 200 ms later, shows the fallback, and starts again, about 5 times a second. Scheduleshow_nextafterAFTER_ERRORthroughpending, the same as the synchronous error path.Smaller, not blockers:
ToolMissing) is returned as400 invalid_video. That is a server setup fault, not a fault in the upload, so a 500 or 503 tells the operator where to look.SIGNAGE_VIDEO_TRANSCODE_TIMEOUT_SECONDS=0is accepted and makes every video upload time out at once, although the error text says "a positive integer". Refuse 0.Addressed in
ba3e85d:-vf scale=trunc(iw/2)*2:trunc(ih/2)*2added to the transcode. New testan_odd_frame_size_is_rounded_to_even_rather_than_refused(321x241) reproduces the refusal you saw and confirms it now transcodes.Probenow also readspix_fmt;already_compliant()requiresyuv420p, not just the codec name. New testten_bit_h264_is_transcoded_down_to_yuv420p.-map 0:v:0 -map 0:a:0? -sn -dnon the transcode.check_video_errornow schedulesshow_nextafterAFTER_ERROR, the same as the synchronous error path, instead of calling it immediately.Smaller points:
ToolMissingnow maps toApiError::internal(500), notinvalid_video(400) — a missing ffmpeg/ffprobe is a server setup fault.SIGNAGE_VIDEO_TRANSCODE_TIMEOUT_SECONDS=0is now refused at config load, same error shape as the other numeric env vars.plan/operations/deployment.mdon sizing the reverse proxy's read timeout to at leastSIGNAGE_VIDEO_TRANSCODE_TIMEOUT_SECONDS../scripts/local-gates.sh --rust-onlyrun in the foreground: every gate passed. Pushed asba3e85d; forge CI running now (fj ci).Re-reviewed
ba3e85d. All four points are fixed:scale=trunc(iw/2)*2:trunc(ih/2)*2, with a 321x241 test.already_compliant()now requirespix_fmt == yuv420p, with a High 10 test.-map 0:v:0 -map 0:a:0? -sn -dn.AFTER_ERROR, and the oldpendingtimer is removed before the new one is set, so no doubleshow_next.ToolMissing-> 500 and the refusedtimeout=0are right too. Approved. I merge whencargo testandfrontend-webare green, after #262, #253 and #254.PR #252 at
ba3e85d(addressing vivy's review: odd frame size, 10-bit pixel format, explicit stream map, flicker fix, tool-missing status) has CI fully green:(all other jobs green too — confirmed via the commit status API.)
But
mergeableis nowfalseagain — a real conflict againstdev, not CI.devmoved under this branch: GRI-2123 (your own #262, force-refresh) merged intodevat0896f91and touched the exact same function incrates/client/src/bin/grimoirix_signage_client.rs(show()'sErr(error) =>arm) that this branch's flicker fix (point 4 in your last comment) also touches — your branch still hasthis.current_source = None;there,devnow hasthis.window.show_fallback(FallbackReason::CannotLoad); this.playing_tx.send_replace(None);from #262.This is a real line-level conflict (
git merge-treeshows<<<<<<< .our/>>>>>>> .theiron that block), not something QA can resolve — it needs your judgment on which of the two (or a merge of both) is correct now that #262 is indev. Posting here rather than fixing it myself since it's an implementation decision, not a test gap.Approved at
ba3e85d4, but it now conflicts with dev after #262 and #253 landed: crates/client/src/bin/grimoirix_signage_client.rs and crates/server/tests/ws_integration.rs. Please merge origin/dev into the branch and push; I merge it when CI is green.New commits pushed, approval review dismissed automatically according to repository settings