Persist video assets and add bounded cancellable processing jobs - #4
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Storage contract
VideoSourceRecord,VideoOutputRecord, andVideoJobRecordtypes share the v2sources,outputs, andjobsmanifest collections with existing image records.sources/videos,outputs/videos, andtemporary/video-jobs; only normalized relative paths are persisted.ManifestDocumentV1, copied privately, atomically migrated, and never rewritten when invalid.MediaAssetRepositoryis canonical;ImageAssetRepositoryremains a compatibility alias.Job contract
queued ? preparing ? processing ? muxing ? completed, with controlledfailedandcanceledterminals.recoveredAfterRestart, and requeue below the two-attempt limit. Missing media and exhausted attempts fail cleanly.Media contract
video, validates decoded FFprobe content with a timeout, rejects extension/container mismatches, nonzero rotation, invalid rates, corrupt media, and configured duration/pixel limits..mp4,video/mp4, H.264,yuv420p, and fast-start. Preserve mode maps only the first audio stream to AAC at 192 kbps; remove mode emits no audio.API contract
/upload_preview,/process_video_async,/progress/<task_id>,/video/<filename>, and/download/<filename>remain deprecated compatibility routes. The active UI no longer calls them.Craft discovery
persistent-video-library,bounded-video-jobs,video-job-cancellation,timestamp-video-preview,audio-preserving-video-export, and range-streaming capabilities.Validation
python check.py: passed Ruff format, Ruff lint, strict Mypy, 197 Python tests, and repository consistency.npm test: 7 Playwright tests passed, including the existing image regressions plus video upload/metadata/timestamp preview/job completion/download and accessible cancellation.git diff --check: passed.qualityandbrowser).Known limitations