title: Correct usage of thread_queue_size in ffmpeg
body: <p>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:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I thought that using such high values for <code>thread_queue_size</code> should put me on the safe site to avoid any <code>buffer xrun</code> errors which I had previously. However, this seems not to be the case. Here is the warning message which appeared during recording:</p>
  
  <pre><code>[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    
  </code></pre>
  
  <p>Two things I do not understand:</p>
  
  <ol>
  <li>Why is <code>x11grab</code> saying the <code>thread_queue_size</code> is <code>8</code>, whereas I set it to <code>1024</code> ?</li>
  <li>Still an <code>ALSA buffer xrun</code> error/warning, despite the <code>thread_queue_size</code> of <code>1024</code>, what values can I put here - what is the maximum and what exactly does the value mean?</li>
  </ol>
  
  <p>Any comments would be greatly appreciated!</p>
  
  <hr>
  
  <p>Versions:</p>
  
  <pre><code>ffmpeg version 3.4.6-0ubuntu0.18.04.1
  Kernel 4.15.0-99-generic
  xubuntu 18.04.4 LTS x86_64
  </code></pre>
  
  <p>. </p>