Skip to content

Feat/media analysis pipeline - #34

Merged
Smasduq merged 3 commits into
mainfrom
feat/media-analysis-pipeline
Jul 28, 2026
Merged

Feat/media analysis pipeline#34
Smasduq merged 3 commits into
mainfrom
feat/media-analysis-pipeline

Conversation

@Smasduq

@Smasduq Smasduq commented Jul 28, 2026

Copy link
Copy Markdown
Member

No description provided.

Smasduq added 3 commits July 27, 2026 23:26
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
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
monteeq-gjvd Ready Ready Preview, Comment Jul 28, 2026 1:56pm
monteeq-nextjs Ready Ready Preview, Comment Jul 28, 2026 1:56pm

@Smasduq
Smasduq merged commit eb46c0a into main Jul 28, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant