2

Question? The task is to record simultaneously everything that we see on the monitor and hear from the speakers.

I wrote the following script:

Set the variable:

speaker=alsa_output.pci-[my speakers].analog-stereo.monitor

We write:

ffmpeg -use_wallclock_as_timestamps 1 -f pulse \
-i $speaker -f x11grab -s 1200x900 -r 15 -i :0.0 \
-vcodec qtrle screencast2.mov

The problem is that the sound is recorded with a delay, and of course I need it synchronously. What is the reason? What to fix?

I plowed the entire I> and could not find the answer.

mchid
  • 43,546
  • 8
  • 97
  • 150
Grannik
  • 21
  • Does it have to be for mov? Have you tried using different encoders? – mchid Feb 09 '22 at 11:32
  • Also, I tried this and I get no audio delay. I am using a USB out for audio so that might make a difference however, it makes it difficult for me to test a solution. However, I did not record for very long. Does the audio start to delay after a certain period of time after you start recording? – mchid Feb 09 '22 at 12:03
  • Also, when you say there is a delay, do you mean to say that the audio is not in sync with the video (when people move their lips the words do not match) or do you mean to say that the audio does not start recording and there is no audio for the first few seconds of the video (but the words do match when the lips move)? – mchid Feb 09 '22 at 12:38
  • when people move their lips the words do not match – Grannik Feb 09 '22 at 22:58
  • Does it help to use different encoders like this? ffmpeg -use_wallclock_as_timestamps 1 -f pulse -i $speaker -f x11grab -s 1200x900 -r 15 -i :0.0 -acodec aac -vcodec mpeg4 -preset medium -qscale:v 0 rec.mkv – mchid Feb 10 '22 at 06:13
  • There's also this similar answer, however, it is outdated and I do not recommend using the ppa. Simply use the ffmpeg command referenced in the question and/or substitute the -vcodec libx264 -crf 0 -preset ultrafast -acodec pcm_s16le file.mkv part at the end of your command. – mchid Feb 10 '22 at 06:16
  • Also, if video quality isn't good, it helps to use -qscale:v 0 – mchid Feb 10 '22 at 06:18
  • mkv? Need to try. – Grannik Feb 13 '22 at 15:19

0 Answers0