feat: panelden video izleme/indirme/silme + eşzamanlı yayın kapasitesi düzeltmesi

- streamIngest worker concurrency 3'ten sabit değildi, artık
  MAX_CONCURRENT_CAPTURES (varsayılan 10) ile ayarlanabiliyor. Eskiden
  3'ten fazla kanal aynı anda canlıya geçerse fazlası, ilk 3'ten biri
  bitene kadar (saatlerce) hiç kayda alınmıyordu.
- Python worker'larda (signal-detection, stt-scoring) bullmq varsayılan
  concurrency'si 1'di — WORKER_CONCURRENCY (varsayılan 5) ile
  paralelleştirildi, birden fazla kanal aynı anda segment/transkript
  üretirse sıraya takılmasın diye.
- Frontend artık shared-media volume'üne bağlı: /api/segments/[id]/video
  route'u Range destekli video stream/indirme sağlıyor. Segment ve
  kanal detay sayfalarına <video> oynatıcı, indirme linki ve onaylı
  silme (RawSegment + CandidateSegment, dosya dahil) eklendi.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-30 18:33:33 +03:00
co-authored by Claude Sonnet 5
parent fd21bbfb14
commit 8a92b9b019
11 changed files with 148 additions and 5 deletions
+9 -1
View File
@@ -172,7 +172,15 @@ async function runCapture(job: Job<StreamIngestJob>): Promise<void> {
export function startStreamIngestWorker(): Worker<StreamIngestJob> {
return new Worker<StreamIngestJob>(QUEUE_NAMES.STREAM_INGEST, runCapture, {
connection: redisConnection,
concurrency: 3,
// Each capture job runs for the entire duration of a live stream
// (potentially hours) before its BullMQ job resolves. If concurrency is
// lower than the number of channels going live at once, the extra
// channels queue behind already-running captures and may not start
// recording until one of those finishes — i.e. effectively never, for
// streams still live. This must cover the realistic simultaneous-channel
// count; the real ceiling is the server's CPU/bandwidth for running that
// many yt-dlp+ffmpeg pairs at once, not this number.
concurrency: env.maxConcurrentCaptures,
// Captures run for the lifetime of the stream (can be hours) — extend the
// default lock well beyond BullMQ's stalled-job assumptions for an MVP.
lockDuration: 24 * 60 * 60 * 1000,
+1
View File
@@ -9,4 +9,5 @@ export const env = {
forceLiveUrl: process.env.FORCE_LIVE_URL ?? "",
ytdlpCookiesB64: process.env.YTDLP_COOKIES_B64 ?? "",
ytdlpPotProviderUrl: process.env.YTDLP_POT_PROVIDER_URL ?? "",
maxConcurrentCaptures: Number(process.env.MAX_CONCURRENT_CAPTURES ?? 10),
};