30 lines
815 B
Python
30 lines
815 B
Python
"""Timeline schema — source of truth for frame sequences."""
|
|
|
|
from dataclasses import dataclass, field
|
|
from datetime import datetime
|
|
from typing import Any, Dict, List, Optional
|
|
from uuid import UUID
|
|
|
|
|
|
@dataclass
|
|
class Timeline:
|
|
"""
|
|
The frame sequence from a source video.
|
|
|
|
Independent of stages — exists before any stage runs.
|
|
Frames stored in MinIO as JPEGs, metadata here.
|
|
One timeline per job.
|
|
"""
|
|
|
|
id: UUID
|
|
source_asset_id: Optional[UUID] = None
|
|
source_video: str = ""
|
|
profile_name: str = ""
|
|
fps: float = 2.0
|
|
|
|
frames_prefix: str = "" # s3: timeline/{id}/frames/
|
|
frames_manifest: Dict[int, str] = field(default_factory=dict) # seq → s3 key
|
|
frames_meta: List[Dict[str, Any]] = field(default_factory=list)
|
|
|
|
created_at: Optional[datetime] = None
|