1

I'm running this command to capture video and audio from my webcam:

ffmpeg -y -f video4linux2 -s 320x240 -i /dev/video0 -f alsa -i "plughw:CARD=U0x46d0x825,DEV=0" -ac 2 -strict experimental Filename.mp4

It works, but the audio is about half a second behind the video (EG if I clap, when I watch the video I'll hear the clap and then see me do it).

This is for an online stream, so I can't fix it up later, it needs to be recorded correctly.

It always seems to be off by the same amount, so I'm trying to find an option to simply delay when audio starts recording, but I can't figure it out.

Any ideas?

2 Answers2

1

See FFmpeg: audio start time way off how I solved a very similar problem. I used to use -itsoffset before, but it is too much guesswork for my taste.

1

Did you give google a try? Look here
They suggest to use -async or -vsync depending on your requirement, or -map in combination with -itsoffset

Using a recent ffmpeg with the following command should do the work:

ffmpeg -y -f video4linux2 -s 320x240 -i /dev/video0 -itsoffset 2 -f alsa -i "plughw:CARD=U0x46d0x825,DEV=0" -ac 2 -strict experimental Filename.mp4
Groxxda
  • 126