playreel/backend/models/longcut.py

35 lines
789 B
Python

from dataclasses import dataclass
from typing import Literal
from PIL import Image
from pydantic import BaseModel
SceneKind = Literal["clip", "stills", "scroll", "poster"]
class Scene(BaseModel):
"""나레이션 큐 하나에 대응하는 화면."""
cue: int
kind: SceneKind
section: str | None = None # scroll일 때 쓸 섹션 이름
tag: str | None = None # 그 섹션의 태그. 왜 골랐는지 남긴다
class LongcutPlan(BaseModel):
scenes: list[Scene]
class EndBandInfo(BaseModel):
"""엔드밴드 두 줄. 위가 공연명, 아래가 일시·장소."""
title: str
detail: str
@dataclass
class LongcutResult:
video: bytes
duration: float
frames: int
plan: LongcutPlan
proof: Image.Image | None = None