- 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>
30 lines
1018 B
Python
30 lines
1018 B
Python
"""Video versions (plan step 5.4e): a video's still frame and a version every screen plays are
|
|
made in the background after the upload; the library shows how far it got.
|
|
|
|
Videos already in the library are queued (`waiting`) so they get theirs too.
|
|
|
|
Revision ID: 0031_video_versions
|
|
Revises: 0030_signage_schedules
|
|
Create Date: 2026-11-18 09:00:00
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
revision = '0031_video_versions'
|
|
down_revision = '0030_signage_schedules'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
with op.batch_alter_table('media', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('processing', sa.String(), nullable=True))
|
|
batch_op.add_column(sa.Column('progress', sa.Integer(), nullable=True))
|
|
op.execute("UPDATE media SET processing = 'waiting' WHERE kind = 'video'")
|
|
|
|
|
|
def downgrade() -> None:
|
|
with op.batch_alter_table('media', schema=None) as batch_op:
|
|
batch_op.drop_column('progress')
|
|
batch_op.drop_column('processing')
|