title: How to generate gif from avi using ffmpeg?
body: <p>I'm trying to extract a part of a video into an animated gif using the following command:</p>
  
  <pre><code>ffmpeg -i video.avi -t 5 out.gif
  </code></pre>
  
  <p>It generates an animated gif but the quality is insane. However when I generate gif image using:</p>
  
  <p><code>ffmpeg -i video.avi -t 10 out%d.gif</code></p>
  
  <p>It generates acceptable quality of gif images. How can i generate animated gif using the first command but the same quality as the second command?</p>