Answers.Body: <p>The separate cropping step is leading to a generational loss. You can combine that and see.</p>
  
  <pre><code>ffmpeg -i in\vlans-3vlans-tag-untag.mp4
         -vf "crop=1262:423:91:154,scale=896:-1:flags=lanczos,fps=35,palettegen"
         out\PALETTE.png
  
  ffmpeg -i in\vlans-3vlans-tag-untag.mp4 -i out\PALETTE.png
         -filter_complex "[0]crop=1262:423:91:154,scale=896:-1:flags=lanczos,fps=35[v];
                          [v][1]paletteuse"
         out\vlans-3vlans-tag-untag.gif
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-27T16:00:06.147Z
Answers.Text: Hrmm, I'm having a hard time seeing a difference. [Here](https://i.sstatic.net/BcKJT.gif) is the image the original way I did it, and [here](http://i.imgur.com/ogrEbwn.gif) it is using the combined crop/convert step.  The 2nd file is slightly smaller, I did notice. So at least that is an improvement.
Answers.UserDisplayName: Eddie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-24T03:51:16.790Z
Answers.LastActivityDate: 2016-06-24T03:51:16.790Z
Answers.UserDisplayName: Gyan
Body: <p>I am using Powerpoint to create animations which I then export into a video and crop and convert to GIF using ffmpeg. </p>
  
  <p><a href="https://www.dropbox.com/s/6zl9ht7mluiim7a/cropped_vlans-3vlans-tag-untag.mp4?dl=1" rel="nofollow noreferrer">Here</a> is the (cropped) MP4 video, and this is the GIF I was able to produce:</p>
  
  <p><a href="https://i.sstatic.net/BcKJT.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BcKJT.gif" alt="enter image description here"></a></p>
  
  <p>To my (untrained) eye, it appears rather grainy, and not terribly smooth. I am wondering if there are options in ffmpeg I can be using thaat will give me a better quality GIF.</p>
  
  <p>Here is the command I am using to crop:</p>
  
  <pre><code>ffmpeg -i in\vlans-3vlans-tag-untag.mp4 -filter:v "crop=1262:423:91:154" in\cropped_vlans-3vlans-tag-untag.mp4
  </code></pre>
  
  <p>Here are the two commands I am using to convert:</p>
  
  <pre><code>ffmpeg -y -vf fps=35,scale=896:-1:flags=lanczos,palettegen out\PALETTE.png -i in\cropped_vlans-3vlans-tag-untag.mp4
  ffmpeg -y -filter_complex "fps=35,scale=896:-1:flags=lanczos[x];[x][1:v]paletteuse" -i in\cropped_vlans-3vlans-tag-untag.mp4 -i out\PALETTE.png  out\vlans-3vlans-tag-untag.gif
  </code></pre>
  
  <p>I should say, I am not particularly talented with ffmpeg, I mostly put these commands together from googling and other posts on this site. So if any of the arguments I am using are making the conversion worse, I'd also be interested in hearing about it.</p>
  
  <p>I tried the <code>-b 2048k</code> option, and I couldn't tell a difference in quality. In fact, when I ran a SHA256 hash on the output file with and without this option, the result was identical.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-27T06:05:05.800Z
Comments.Text: I find that ffmpeg does a fairly poor job with gifs. Have a look at gifsicle, I use it to compile my gifs and imagemagick to create the source gifs from pngs I export using ffmpeg. I find it produces higher quality, smaller results, at the expense of a bit more faffing around. http://www.lcdf.org/gifsicle/ and http://imagemagick.org/
Comments.UserDisplayName: stib
Tags: <ffmpeg>
Title: Is this as high quality a GIF I can produce from this MP4 using FFMPEG?
UserDisplayName: Eddie
ThreadText: # Is this as high quality a GIF I can produce from this MP4 using FFMPEG?
  
  (Asked by: username_0 on 2016-06-23)
  
  I am using Powerpoint to create animations which I then export into a video and crop and convert to GIF using ffmpeg.
  
  [Here](https://www.dropbox.com/s/6zl9ht7mluiim7a/cropped_vlans-3vlans-tag-untag.mp4?dl=1) is the (cropped) MP4 video, and this is the GIF I was able to produce:
  
  [![enter image description here](https://i.sstatic.net/BcKJT.gif)](https://i.sstatic.net/BcKJT.gif)
  
  To my (untrained) eye, it appears rather grainy, and not terribly smooth. I am wondering if there are options in ffmpeg I can be using thaat will give me a better quality GIF.
  
  Here is the command I am using to crop:
  
  ```
  ffmpeg -i in\vlans-3vlans-tag-untag.mp4 -filter:v "crop=1262:423:91:154" in\cropped_vlans-3vlans-tag-untag.mp4
  
  ```
  
  Here are the two commands I am using to convert:
  
  ```
  ffmpeg -y -vf fps=35,scale=896:-1:flags=lanczos,palettegen out\PALETTE.png -i in\cropped_vlans-3vlans-tag-untag.mp4
  ffmpeg -y -filter_complex "fps=35,scale=896:-1:flags=lanczos[x];[x][1:v]paletteuse" -i in\cropped_vlans-3vlans-tag-untag.mp4 -i out\PALETTE.png  out\vlans-3vlans-tag-untag.gif
  
  ```
  
  I should say, I am not particularly talented with ffmpeg, I mostly put these commands together from googling and other posts on this site. So if any of the arguments I am using are making the conversion worse, I'd also be interested in hearing about it.
  
  I tried the `-b 2048k` option, and I couldn't tell a difference in quality. In fact, when I ran a SHA256 hash on the output file with and without this option, the result was identical.
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: I find that ffmpeg does a fairly poor job with gifs. Have a look at gifsicle, I use it to compile my gifs and imagemagick to create the source gifs from pngs I export using ffmpeg. I find it produces higher quality, smaller results, at the expense of a bit more faffing around. http://www.lcdf.org/gifsicle/ and http://imagemagick.org/  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-06-24. Score: 1 | Accepted answer
  
  The separate cropping step is leading to a generational loss. You can combine that and see.
  
  ```
  ffmpeg -i in\vlans-3vlans-tag-untag.mp4
         -vf "crop=1262:423:91:154,scale=896:-1:flags=lanczos,fps=35,palettegen"
         out\PALETTE.png
  
  ffmpeg -i in\vlans-3vlans-tag-untag.mp4 -i out\PALETTE.png
         -filter_complex "[0]crop=1262:423:91:154,scale=896:-1:flags=lanczos,fps=35[v];
                          [v][1]paletteuse"
         out\vlans-3vlans-tag-untag.gif
  
  ```
  
  > **Comments:**
  > **username_0**: Hrmm, I'm having a hard time seeing a difference. [Here](https://i.sstatic.net/BcKJT.gif) is the image the original way I did it, and [here](http://i.imgur.com/ogrEbwn.gif) it is using the combined crop/convert step.  The 2nd file is slightly smaller, I did notice. So at least that is an improvement.  
  
  ---
  
  