Converting a movie to a gif (ffmpeg & gifsicle), irregular output dimensions causes much larger file size

0

I'm converting a .mov file to a .gif using ffmpeg and gifsicle, based on these instructions; the specific command I'm running is

ffmpeg -i in.mov -pix_fmt rgb24 -r 10 -s [WxH] -f gif - | gifsicle --optimize=3 --delay=8 > out.gif

with various actual values for WxH.

My movie is roughly square, so I used 600x600 as WxH; that worked fairly well, I got a 603KB output gif; but it's slightly distorted, since my original isn't perfectly square.

I decided to do better and calculate more exact dimensions that would be proportional to the original gif; and came up with 573x558. That single change produced a whopping 7.2MB output gif; despite being smaller than the original.

I'm really just curious why this is, (and, I suppose, if there's a proper way to do this sort of proportional reduction when converting a movie to a gif) I found this result really unintuitive; but then I know very little about the tools I'm using here.

Retsam

Posted 2016-09-09T15:58:04.943

Reputation: 101

Try ffmpeg -i in.mov -vf fps=10,scale=W:-2,format=rgb24 -f gif - where W should be replaced with the width. – Gyan – 2016-09-09T16:11:21.663

@Mulvya Putting 600 for W in your command gave me output dimensions of 600x584 and an output file size of 8.9MB. – Retsam – 2016-09-09T16:17:40.010

If you output to MP4 instead of piping a GIF, is the size that different 600x600 vs 600x584 – Gyan – 2016-09-09T16:34:28.020

No answers