This is on linux with pulseaudio. I need to record a video with a rather bare-bones recorder that runs in chrome. I decided to fake a camera and a mic so that I can edit the video then use ffmpeg to send the video to a dummy camera created with v4l2loopback and set the chrome input in pavucontrol. This s what I have:
ffmpeg -re -i ~/xxx.mp4 -map 0:v -f v4l2 /dev/video2 -f pulse "alsa_output.pci-0000_00_1f.3.analog-stereo.monitor"
where /dev/video2 is the loopback camera. This seems to work fine, but the audio lags the video by a few seconds. I verified that they are very much in sync by playing the mp4 normally. How do I fix this?