title: Got black screen when recording screen by x11grab device
body: <p>I'm trying to record video from a firefox run by <code>xvfb-run</code> but it always output nothing in the video file except black screen.</p>
  
  <p>Here's what I did:</p>
  
  <p>start a firefox, open google.com:</p>
  
  <pre><code>$ xvfb-run firefox https://google.com
  </code></pre>
  
  <p>Then it will use the default display server number 99. I can see the display information by command <code>xdpyinfo -display :99</code>.</p>
  
  <p>A screenshot works very well by command:</p>
  
  <pre><code>$ xwd -root -silent -display :99.0 | xwdtopnm |pnmtojpeg &gt; screen.jpg
  </code></pre>
  
  <p>Start using ffmpeg to record a video:</p>
  
  <pre><code>$ ffmpeg -f x11grab -i :99.0 out.mpg
  </code></pre>
  
  <p>When I play the video file <code>out.mpg</code>, there's black screen all the time.</p>
  
  <p>Is there any parameter I missed? </p>