diff --git a/services/capture/src/capture-manager.js b/services/capture/src/capture-manager.js index c14fec1..5e334ed 100644 --- a/services/capture/src/capture-manager.js +++ b/services/capture/src/capture-manager.js @@ -720,15 +720,11 @@ class CaptureManager { '-video_size', fcSize, '-framerate', fcFps, '-i', 'pipe:0', - // Audio FIFO → ffmpeg input 1. The bridge flushes its slot backlog to - // the live edge on reader-attach, so the FIFO delivers live audio in - // lockstep with the video. We DERIVE audio PTS from the s16le sample - // count starting at 0 — the SAME origin as the video's frame-0 PTS — - // rather than from wall-clock arrival. Wall-clock stamped the first - // audio chunk at a time offset from video frame 0, and the master - // aresample then PADDED ~2.5s of leading silence to align them. With - // sample-count PTS both streams share one origin → no pad, no leading - // silence, length locked. + // Audio FIFO → ffmpeg input 1. Wallclock timestamps + master + // aresample=async=1 is the proven-clean A/V config; both inputs must + // start from the live edge (see the fc_pipe + audio flush at record + // start) so aresample has minimal correction to do. + '-use_wallclock_as_timestamps', '1', '-thread_queue_size', '512', '-f', 's16le', '-ar', '48000',