fix(audio): use_wallclock_as_timestamps on both raw FIFOs to align A/V by arrival time (no deadlock, replaces barrier)

This commit is contained in:
Zac Gaetano 2026-06-02 22:02:32 +00:00
parent d0d881c735
commit 228f68ab6d

View file

@ -613,11 +613,22 @@ class CaptureManager {
return { return {
inputArgs: [ 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', '-f', 'rawvideo',
'-pix_fmt', 'uyvy422', '-pix_fmt', 'uyvy422',
'-video_size', dcSize, '-video_size', dcSize,
'-framerate', dcFps, '-framerate', dcFps,
'-i', videoFifo, '-i', videoFifo,
'-use_wallclock_as_timestamps', '1',
'-thread_queue_size', '512',
'-f', 's16le', '-f', 's16le',
'-ar', '48000', '-ar', '48000',
'-ac', '2', '-ac', '2',