diff --git a/services/capture/src/capture-manager.js b/services/capture/src/capture-manager.js index 0dc17cc..9003b3b 100644 --- a/services/capture/src/capture-manager.js +++ b/services/capture/src/capture-manager.js @@ -613,11 +613,22 @@ class CaptureManager { return { inputArgs: [ + // Both raw FIFOs are timestampless. ffmpeg opens input 0 (video) and + // input 1 (audio) at slightly different moments, so PTS-zeroing each + // stream's first byte would bake in a fixed A/V offset. Stamping each + // input by wall-clock ARRIVAL time aligns them by real time regardless + // of FIFO open order — the robust fix for the A/V start offset. + // Large thread_queue_size avoids "thread message queue blocking" on + // the high-bitrate raw video FIFO. + '-use_wallclock_as_timestamps', '1', + '-thread_queue_size', '512', '-f', 'rawvideo', '-pix_fmt', 'uyvy422', '-video_size', dcSize, '-framerate', dcFps, '-i', videoFifo, + '-use_wallclock_as_timestamps', '1', + '-thread_queue_size', '512', '-f', 's16le', '-ar', '48000', '-ac', '2',