diff --git a/services/capture/src/capture-manager.js b/services/capture/src/capture-manager.js index 39433a1..e12b2a2 100644 --- a/services/capture/src/capture-manager.js +++ b/services/capture/src/capture-manager.js @@ -920,8 +920,15 @@ class CaptureManager { args.push('-filter_complex', filterComplex); // (a) VC-3/DNxHD master (8-bit 4:2:2) -> MXF OP1a, growing-readable. + // `-threads 16 -thread_type slice`: CRITICAL for the first ~10s. With ffmpeg's + // DEFAULT frame-threading, dnxhd buffers a long pipeline before output starts + // — it runs at ~0.27x for the first few seconds, so the fc_pipe ring overflows + // and ~344 startup frames are DROPPED (spotty audio+video for ~10s). Explicit + // slice threading makes dnxhd encode >= realtime from frame 1 (measured 1.3x + // at start vs 0.27x), eliminating the startup backlog and the dropped frames. args.push('-map', '[vhi]', - '-c:v', 'dnxhd', '-b:v', vb, '-pix_fmt', 'yuv422p', + '-c:v', 'dnxhd', '-threads', '32', '-thread_type', 'slice', + '-b:v', vb, '-pix_fmt', 'yuv422p', '-r', framerate || '60000/1001', '-map', audioMap, '-c:a', 'pcm_s24le', '-ar', '48000', '-ac', String(ach), '-f', 'mxf', outPath);