I am doing a screencast where I am recording what is going on at my screen together with simultaneous audio comments from an external USB microphone. I am using the following command:
ffmpeg -f x11grab -r 25 -s 1280x720 -i :0.0+320,236 -thread_queue_size 1024 -f alsa -thread_queue_size 1024 -i hw:1 -vcodec huffyuv screencast.mkv
I thought that using such high values for thread_queue_size
should put me on the safe site to avoid any buffer xrun
errors which I had previously. However, this seems not to be the case. Here is the warning message which appeared during recording:
[x11grab @ 0x55ffe44e6a40] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[alsa @ 0x55ffe44efe80] Thread message queue blocking; consider raising the thread_queue_size option (current value: 1024)
[alsa @ 0x55ffe44efe80] ALSA buffer xrun.B time=00:07:35.96 bitrate=203382.4kbits/s speed=0.994x
[alsa @ 0x55ffe44efe80] ALSA buffer xrun.B time=00:20:18.76 bitrate=210805.7kbits/s speed=0.998x
Two things I do not understand:
- Why is
x11grab
saying thethread_queue_size
is8
, whereas I set it to1024
? - Still an
ALSA buffer xrun
error/warning, despite thethread_queue_size
of1024
, what values can I put here - what is the maximum and what exactly does the value mean?
Any comments would be greatly appreciated!
Versions:
ffmpeg version 3.4.6-0ubuntu0.18.04.1
Kernel 4.15.0-99-generic
xubuntu 18.04.4 LTS x86_64
.
-thread_queue_size
is per-input and is applied to the first input specified after it. So, in your command, it's applied only to the audio input. Place it before-i :0.0+320,236
as well. – Periodatethread_queue_size
"is applied to the first input specified after it." That is indeed incredibly helpful, thank you!! – Seaweed-f alsa
(like I have done it) as thisthread_queue_size
would refer to the next input which is-i hw:1
and this already has athread_queue_size
in front of it? – Seaweed