feat(media): video versions: still frame + a version every screen plays (platform-v2 5.4e)

- services/video.py: background worker (one video at a time, low priority) makes a still
  frame (thumb/card/full WebP) and, when needed, play.mp4 (H.264+AAC, <=1920 px, HDR
  tone-mapped, faststart); the original is kept. Media.processing/progress (migration 0031,
  existing videos queued). ffmpeg from the pinned imageio-ffmpeg wheel; none = as uploaded.
- MOV (video/quicktime) accepted; /api/media/file/<sha>/play served with ranges.
- Signage plays the version (poster = still frame) and tells the screens playing it when ready.
- Manager library: still frames in the grid, preparing progress, status in the details.
- Tests: test_video.py (8), backend 541 passed; e2e media/signage/stack new checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 02:10:22 +02:00
co-authored by Claude Opus 5.5
parent f8d0d29d8f
commit b5361e10ca
28 changed files with 756 additions and 39 deletions
@@ -9,7 +9,7 @@ import { errorMessage } from '@xenia/api'
import { useTranslation } from '@xenia/i18n'
import { Button, EmptyState, Input, Select, Spinner, cx } from '@xenia/ui'
import { listMedia } from './mediaApi'
import { ACCEPT } from './mediaLogic'
import { ACCEPT, preparing } from './mediaLogic'
import MediaDetails from './MediaDetails'
import { MediaGrid, UploadQueue } from './MediaParts'
import { useUploadQueue } from './mediaHooks'
@@ -32,6 +32,13 @@ export default function MediaPage() {
try { setPage(await listMedia({ kind, q: search, collection })); setError(null) } catch (err) { setError(errorMessage(err, t)) }
}, [kind, search, collection, t])
useEffect(() => { load() }, [load])
// Videos are prepared for screens in the background (5.4e): read the list again while any is.
const busy = preparing(page?.items)
useEffect(() => {
if (!busy) return
const h = setInterval(load, 3000)
return () => clearInterval(h)
}, [busy, load])
// Each finished upload shows at once; the list is read again when the batch is done.
const { queue, add, clear, summary } = useUploadQueue(useCallback(item => {