Feat/media analysis pipeline - #34
Merged
Merged
Conversation
Backend: - Add video_events table migration (e8a1b2c3d4f5) with indexes on (user_id, created_at), (video_id, event_type), (video_id, created_at) - Add Pydantic schema with VideoEventType enum validation - Add POST /api/events/video ingestion endpoint (202 Accepted) that batch-pushes events to Redis via RPUSH - Add Celery periodic task flush_video_events (every 60s) that LPOPs up to 500 events and bulk-inserts into Postgres, routing failures to video_events:failed dead-letter list Frontend: - Add useVideoEvents hook with client-side batching (flush every 5s or on unmount), per-session dedup via ref flags, and threshold detection (view/watch_25/50/75/complete/skip/like/share) - Integrate into VideoPlayerV2: view on first play, thresholds in handleTimeUpdate, skip on early unmount - Integrate into FlashCard: view on active, thresholds in handleTimeUpdate, skip/like/share on sidebar actions - Integrate into WatchView: like and share events
- Add media_analysis table migration with pgvector(384) embedding,
JSONB columns for frame_sample_paths, scene_cuts, beat_timestamps
- Create app/services/media_analysis.py with modular pipeline:
ffmpeg frame extraction (1fps), pyscenedetect ContentDetector,
librosa beat tracking, sentence-transformers caption embedding
- Add Celery task analyze_media (max_retries=2, 120s backoff)
that downloads HLS stream, runs pipeline, writes results to Postgres
- Fire-and-forget hook in _finalize_transcode_success triggers
analyze_media.delay() after transcode completes
- Add GET /api/videos/{video_id}/analysis endpoint
- Add requirements: pyscenedetect, librosa, sentence-transformers, pgvector
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
No description provided.